refactor: 将 DTO 文件从 internal/model 移动到 internal/model/dto 目录
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 4m22s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 4m22s
- 移动 17 个 DTO 文件到 internal/model/dto/ 目录 - 更新所有 DTO 文件的 package 声明从 model 改为 dto - 更新所有引用文件的 import 和类型引用 - Handler 层:admin 和 h5 所有处理器 - Service 层:所有业务服务 - Routes 层:所有路由定义 - Tests 层:单元测试和集成测试 - 清理未使用的 import 语句 - 验证:项目构建成功,测试编译通过,LSP 无错误
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
|
||||
"github.com/break/junhong_cmp_fiber/internal/model"
|
||||
"github.com/break/junhong_cmp_fiber/internal/model/dto"
|
||||
accountService "github.com/break/junhong_cmp_fiber/internal/service/account"
|
||||
)
|
||||
|
||||
@@ -27,7 +27,7 @@ func NewAccountHandler(service *accountService.Service) *AccountHandler {
|
||||
// Create 创建账号
|
||||
// POST /api/v1/accounts
|
||||
func (h *AccountHandler) Create(c *fiber.Ctx) error {
|
||||
var req model.CreateAccountRequest
|
||||
var req dto.CreateAccountRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -64,7 +64,7 @@ func (h *AccountHandler) Update(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的账号 ID")
|
||||
}
|
||||
|
||||
var req model.UpdateAccountRequest
|
||||
var req dto.UpdateAccountRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -95,7 +95,7 @@ func (h *AccountHandler) Delete(c *fiber.Ctx) error {
|
||||
// List 查询账号列表
|
||||
// GET /api/v1/accounts
|
||||
func (h *AccountHandler) List(c *fiber.Ctx) error {
|
||||
var req model.AccountListRequest
|
||||
var req dto.AccountListRequest
|
||||
if err := c.QueryParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -116,7 +116,7 @@ func (h *AccountHandler) AssignRoles(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的账号 ID")
|
||||
}
|
||||
|
||||
var req model.AssignRolesRequest
|
||||
var req dto.AssignRolesRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -173,7 +173,7 @@ func (h *AccountHandler) UpdatePassword(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的账号 ID")
|
||||
}
|
||||
|
||||
var req model.UpdatePasswordRequest
|
||||
var req dto.UpdatePasswordRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -193,7 +193,7 @@ func (h *AccountHandler) UpdateStatus(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的账号 ID")
|
||||
}
|
||||
|
||||
var req model.UpdateStatusRequest
|
||||
var req dto.UpdateStatusRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -208,7 +208,7 @@ func (h *AccountHandler) UpdateStatus(c *fiber.Ctx) error {
|
||||
// ListPlatformAccounts 查询平台账号列表
|
||||
// GET /api/admin/platform-accounts
|
||||
func (h *AccountHandler) ListPlatformAccounts(c *fiber.Ctx) error {
|
||||
var req model.PlatformAccountListRequest
|
||||
var req dto.PlatformAccountListRequest
|
||||
if err := c.QueryParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"github.com/break/junhong_cmp_fiber/internal/model"
|
||||
"github.com/break/junhong_cmp_fiber/internal/model/dto"
|
||||
"github.com/break/junhong_cmp_fiber/internal/service/auth"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/errors"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/middleware"
|
||||
@@ -26,7 +26,7 @@ func NewAuthHandler(authService *auth.Service, validator *validator.Validate) *A
|
||||
|
||||
// Login 后台登录
|
||||
func (h *AuthHandler) Login(c *fiber.Ctx) error {
|
||||
var req model.LoginRequest
|
||||
var req dto.LoginRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -55,7 +55,7 @@ func (h *AuthHandler) Logout(c *fiber.Ctx) error {
|
||||
}
|
||||
|
||||
refreshToken := ""
|
||||
var req model.RefreshTokenRequest
|
||||
var req dto.RefreshTokenRequest
|
||||
if err := c.BodyParser(&req); err == nil {
|
||||
refreshToken = req.RefreshToken
|
||||
}
|
||||
@@ -71,7 +71,7 @@ func (h *AuthHandler) Logout(c *fiber.Ctx) error {
|
||||
|
||||
// RefreshToken 刷新访问令牌
|
||||
func (h *AuthHandler) RefreshToken(c *fiber.Ctx) error {
|
||||
var req model.RefreshTokenRequest
|
||||
var req dto.RefreshTokenRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -87,7 +87,7 @@ func (h *AuthHandler) RefreshToken(c *fiber.Ctx) error {
|
||||
return err
|
||||
}
|
||||
|
||||
resp := &model.RefreshTokenResponse{
|
||||
resp := &dto.RefreshTokenResponse{
|
||||
AccessToken: newAccessToken,
|
||||
ExpiresIn: 86400,
|
||||
}
|
||||
@@ -124,7 +124,7 @@ func (h *AuthHandler) ChangePassword(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeUnauthorized, "未授权访问")
|
||||
}
|
||||
|
||||
var req model.ChangePasswordRequest
|
||||
var req dto.ChangePasswordRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
|
||||
"github.com/break/junhong_cmp_fiber/internal/model"
|
||||
"github.com/break/junhong_cmp_fiber/internal/model/dto"
|
||||
commissionWithdrawalService "github.com/break/junhong_cmp_fiber/internal/service/commission_withdrawal"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/errors"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/response"
|
||||
@@ -20,7 +20,7 @@ func NewCommissionWithdrawalHandler(service *commissionWithdrawalService.Service
|
||||
}
|
||||
|
||||
func (h *CommissionWithdrawalHandler) ListWithdrawalRequests(c *fiber.Ctx) error {
|
||||
var req model.WithdrawalRequestListReq
|
||||
var req dto.WithdrawalRequestListReq
|
||||
if err := c.QueryParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -39,7 +39,7 @@ func (h *CommissionWithdrawalHandler) ApproveWithdrawal(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的提现申请ID")
|
||||
}
|
||||
|
||||
var req model.ApproveWithdrawalReq
|
||||
var req dto.ApproveWithdrawalReq
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -58,7 +58,7 @@ func (h *CommissionWithdrawalHandler) RejectWithdrawal(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的提现申请ID")
|
||||
}
|
||||
|
||||
var req model.RejectWithdrawalReq
|
||||
var req dto.RejectWithdrawalReq
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package admin
|
||||
import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
|
||||
"github.com/break/junhong_cmp_fiber/internal/model"
|
||||
"github.com/break/junhong_cmp_fiber/internal/model/dto"
|
||||
commissionWithdrawalSettingService "github.com/break/junhong_cmp_fiber/internal/service/commission_withdrawal_setting"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/errors"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/response"
|
||||
@@ -18,7 +18,7 @@ func NewCommissionWithdrawalSettingHandler(service *commissionWithdrawalSettingS
|
||||
}
|
||||
|
||||
func (h *CommissionWithdrawalSettingHandler) Create(c *fiber.Ctx) error {
|
||||
var req model.CreateWithdrawalSettingReq
|
||||
var req dto.CreateWithdrawalSettingReq
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -32,7 +32,7 @@ func (h *CommissionWithdrawalSettingHandler) Create(c *fiber.Ctx) error {
|
||||
}
|
||||
|
||||
func (h *CommissionWithdrawalSettingHandler) List(c *fiber.Ctx) error {
|
||||
var req model.WithdrawalSettingListReq
|
||||
var req dto.WithdrawalSettingListReq
|
||||
if err := c.QueryParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
|
||||
"github.com/break/junhong_cmp_fiber/internal/model"
|
||||
"github.com/break/junhong_cmp_fiber/internal/model/dto"
|
||||
customerAccountService "github.com/break/junhong_cmp_fiber/internal/service/customer_account"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/errors"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/response"
|
||||
@@ -20,7 +20,7 @@ func NewCustomerAccountHandler(service *customerAccountService.Service) *Custome
|
||||
}
|
||||
|
||||
func (h *CustomerAccountHandler) List(c *fiber.Ctx) error {
|
||||
var req model.CustomerAccountListReq
|
||||
var req dto.CustomerAccountListReq
|
||||
if err := c.QueryParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -34,7 +34,7 @@ func (h *CustomerAccountHandler) List(c *fiber.Ctx) error {
|
||||
}
|
||||
|
||||
func (h *CustomerAccountHandler) Create(c *fiber.Ctx) error {
|
||||
var req model.CreateCustomerAccountReq
|
||||
var req dto.CreateCustomerAccountReq
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -54,7 +54,7 @@ func (h *CustomerAccountHandler) Update(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的账号ID")
|
||||
}
|
||||
|
||||
var req model.UpdateCustomerAccountRequest
|
||||
var req dto.UpdateCustomerAccountRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -74,7 +74,7 @@ func (h *CustomerAccountHandler) UpdatePassword(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的账号ID")
|
||||
}
|
||||
|
||||
var req model.UpdateCustomerAccountPasswordRequest
|
||||
var req dto.UpdateCustomerAccountPasswordRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -93,7 +93,7 @@ func (h *CustomerAccountHandler) UpdateStatus(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的账号ID")
|
||||
}
|
||||
|
||||
var req model.UpdateCustomerAccountStatusRequest
|
||||
var req dto.UpdateCustomerAccountStatusRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
|
||||
"github.com/break/junhong_cmp_fiber/internal/model"
|
||||
"github.com/break/junhong_cmp_fiber/internal/model/dto"
|
||||
enterpriseService "github.com/break/junhong_cmp_fiber/internal/service/enterprise"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/errors"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/response"
|
||||
@@ -20,7 +20,7 @@ func NewEnterpriseHandler(service *enterpriseService.Service) *EnterpriseHandler
|
||||
}
|
||||
|
||||
func (h *EnterpriseHandler) Create(c *fiber.Ctx) error {
|
||||
var req model.CreateEnterpriseReq
|
||||
var req dto.CreateEnterpriseReq
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -34,7 +34,7 @@ func (h *EnterpriseHandler) Create(c *fiber.Ctx) error {
|
||||
}
|
||||
|
||||
func (h *EnterpriseHandler) List(c *fiber.Ctx) error {
|
||||
var req model.EnterpriseListReq
|
||||
var req dto.EnterpriseListReq
|
||||
if err := c.QueryParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -54,7 +54,7 @@ func (h *EnterpriseHandler) Update(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的企业ID")
|
||||
}
|
||||
|
||||
var req model.UpdateEnterpriseBody
|
||||
var req dto.UpdateEnterpriseBody
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -74,7 +74,7 @@ func (h *EnterpriseHandler) UpdateStatus(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的企业ID")
|
||||
}
|
||||
|
||||
var req model.UpdateEnterpriseStatusBody
|
||||
var req dto.UpdateEnterpriseStatusBody
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -93,7 +93,7 @@ func (h *EnterpriseHandler) UpdatePassword(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的企业ID")
|
||||
}
|
||||
|
||||
var req model.UpdateEnterprisePasswordBody
|
||||
var req dto.UpdateEnterprisePasswordBody
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
|
||||
"github.com/break/junhong_cmp_fiber/internal/model"
|
||||
"github.com/break/junhong_cmp_fiber/internal/model/dto"
|
||||
enterpriseCardService "github.com/break/junhong_cmp_fiber/internal/service/enterprise_card"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/errors"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/response"
|
||||
@@ -26,7 +26,7 @@ func (h *EnterpriseCardHandler) AllocateCardsPreview(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的企业ID")
|
||||
}
|
||||
|
||||
var req model.AllocateCardsPreviewReq
|
||||
var req dto.AllocateCardsPreviewReq
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -46,7 +46,7 @@ func (h *EnterpriseCardHandler) AllocateCards(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的企业ID")
|
||||
}
|
||||
|
||||
var req model.AllocateCardsReq
|
||||
var req dto.AllocateCardsReq
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -66,7 +66,7 @@ func (h *EnterpriseCardHandler) RecallCards(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的企业ID")
|
||||
}
|
||||
|
||||
var req model.RecallCardsReq
|
||||
var req dto.RecallCardsReq
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -86,7 +86,7 @@ func (h *EnterpriseCardHandler) ListCards(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的企业ID")
|
||||
}
|
||||
|
||||
var req model.EnterpriseCardListReq
|
||||
var req dto.EnterpriseCardListReq
|
||||
if err := c.QueryParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package admin
|
||||
import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
|
||||
"github.com/break/junhong_cmp_fiber/internal/model"
|
||||
"github.com/break/junhong_cmp_fiber/internal/model/dto"
|
||||
myCommissionService "github.com/break/junhong_cmp_fiber/internal/service/my_commission"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/errors"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/response"
|
||||
@@ -27,7 +27,7 @@ func (h *MyCommissionHandler) GetSummary(c *fiber.Ctx) error {
|
||||
}
|
||||
|
||||
func (h *MyCommissionHandler) CreateWithdrawal(c *fiber.Ctx) error {
|
||||
var req model.CreateMyWithdrawalReq
|
||||
var req dto.CreateMyWithdrawalReq
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -41,7 +41,7 @@ func (h *MyCommissionHandler) CreateWithdrawal(c *fiber.Ctx) error {
|
||||
}
|
||||
|
||||
func (h *MyCommissionHandler) ListWithdrawals(c *fiber.Ctx) error {
|
||||
var req model.MyWithdrawalListReq
|
||||
var req dto.MyWithdrawalListReq
|
||||
if err := c.QueryParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -55,7 +55,7 @@ func (h *MyCommissionHandler) ListWithdrawals(c *fiber.Ctx) error {
|
||||
}
|
||||
|
||||
func (h *MyCommissionHandler) ListRecords(c *fiber.Ctx) error {
|
||||
var req model.MyCommissionRecordListReq
|
||||
var req dto.MyCommissionRecordListReq
|
||||
if err := c.QueryParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package admin
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/break/junhong_cmp_fiber/internal/model"
|
||||
"github.com/break/junhong_cmp_fiber/internal/model/dto"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
|
||||
"github.com/break/junhong_cmp_fiber/pkg/errors"
|
||||
@@ -25,7 +25,7 @@ func NewPermissionHandler(service *permissionService.Service) *PermissionHandler
|
||||
// Create 创建权限
|
||||
// POST /api/v1/permissions
|
||||
func (h *PermissionHandler) Create(c *fiber.Ctx) error {
|
||||
var req model.CreatePermissionRequest
|
||||
var req dto.CreatePermissionRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -62,7 +62,7 @@ func (h *PermissionHandler) Update(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的权限 ID")
|
||||
}
|
||||
|
||||
var req model.UpdatePermissionRequest
|
||||
var req dto.UpdatePermissionRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -93,7 +93,7 @@ func (h *PermissionHandler) Delete(c *fiber.Ctx) error {
|
||||
// List 查询权限列表
|
||||
// GET /api/v1/permissions
|
||||
func (h *PermissionHandler) List(c *fiber.Ctx) error {
|
||||
var req model.PermissionListRequest
|
||||
var req dto.PermissionListRequest
|
||||
if err := c.QueryParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"github.com/break/junhong_cmp_fiber/pkg/errors"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/response"
|
||||
|
||||
"github.com/break/junhong_cmp_fiber/internal/model"
|
||||
"github.com/break/junhong_cmp_fiber/internal/model/dto"
|
||||
roleService "github.com/break/junhong_cmp_fiber/internal/service/role"
|
||||
)
|
||||
|
||||
@@ -25,7 +25,7 @@ func NewRoleHandler(service *roleService.Service) *RoleHandler {
|
||||
// Create 创建角色
|
||||
// POST /api/v1/roles
|
||||
func (h *RoleHandler) Create(c *fiber.Ctx) error {
|
||||
var req model.CreateRoleRequest
|
||||
var req dto.CreateRoleRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -62,7 +62,7 @@ func (h *RoleHandler) Update(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的角色 ID")
|
||||
}
|
||||
|
||||
var req model.UpdateRoleRequest
|
||||
var req dto.UpdateRoleRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -93,7 +93,7 @@ func (h *RoleHandler) Delete(c *fiber.Ctx) error {
|
||||
// List 查询角色列表
|
||||
// GET /api/v1/roles
|
||||
func (h *RoleHandler) List(c *fiber.Ctx) error {
|
||||
var req model.RoleListRequest
|
||||
var req dto.RoleListRequest
|
||||
if err := c.QueryParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -114,7 +114,7 @@ func (h *RoleHandler) AssignPermissions(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的角色 ID")
|
||||
}
|
||||
|
||||
var req model.AssignPermissionsRequest
|
||||
var req dto.AssignPermissionsRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -171,7 +171,7 @@ func (h *RoleHandler) UpdateStatus(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的角色 ID")
|
||||
}
|
||||
|
||||
var req model.UpdateRoleStatusRequest
|
||||
var req dto.UpdateRoleStatusRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
|
||||
"github.com/break/junhong_cmp_fiber/internal/model"
|
||||
"github.com/break/junhong_cmp_fiber/internal/model/dto"
|
||||
shopService "github.com/break/junhong_cmp_fiber/internal/service/shop"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/errors"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/response"
|
||||
@@ -20,7 +20,7 @@ func NewShopHandler(service *shopService.Service) *ShopHandler {
|
||||
}
|
||||
|
||||
func (h *ShopHandler) List(c *fiber.Ctx) error {
|
||||
var req model.ShopListRequest
|
||||
var req dto.ShopListRequest
|
||||
if err := c.QueryParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -34,7 +34,7 @@ func (h *ShopHandler) List(c *fiber.Ctx) error {
|
||||
}
|
||||
|
||||
func (h *ShopHandler) Create(c *fiber.Ctx) error {
|
||||
var req model.CreateShopRequest
|
||||
var req dto.CreateShopRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -53,7 +53,7 @@ func (h *ShopHandler) Update(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的店铺 ID")
|
||||
}
|
||||
|
||||
var req model.UpdateShopRequest
|
||||
var req dto.UpdateShopRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
|
||||
"github.com/break/junhong_cmp_fiber/internal/model"
|
||||
"github.com/break/junhong_cmp_fiber/internal/model/dto"
|
||||
shopAccountService "github.com/break/junhong_cmp_fiber/internal/service/shop_account"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/errors"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/response"
|
||||
@@ -20,7 +20,7 @@ func NewShopAccountHandler(service *shopAccountService.Service) *ShopAccountHand
|
||||
}
|
||||
|
||||
func (h *ShopAccountHandler) List(c *fiber.Ctx) error {
|
||||
var req model.ShopAccountListRequest
|
||||
var req dto.ShopAccountListRequest
|
||||
if err := c.QueryParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -34,7 +34,7 @@ func (h *ShopAccountHandler) List(c *fiber.Ctx) error {
|
||||
}
|
||||
|
||||
func (h *ShopAccountHandler) Create(c *fiber.Ctx) error {
|
||||
var req model.CreateShopAccountRequest
|
||||
var req dto.CreateShopAccountRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -53,7 +53,7 @@ func (h *ShopAccountHandler) Update(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的账号 ID")
|
||||
}
|
||||
|
||||
var req model.UpdateShopAccountRequest
|
||||
var req dto.UpdateShopAccountRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -72,7 +72,7 @@ func (h *ShopAccountHandler) UpdatePassword(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的账号 ID")
|
||||
}
|
||||
|
||||
var req model.UpdateShopAccountPasswordRequest
|
||||
var req dto.UpdateShopAccountPasswordRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -90,7 +90,7 @@ func (h *ShopAccountHandler) UpdateStatus(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的账号 ID")
|
||||
}
|
||||
|
||||
var req model.UpdateShopAccountStatusRequest
|
||||
var req dto.UpdateShopAccountStatusRequest
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
|
||||
"github.com/break/junhong_cmp_fiber/internal/model"
|
||||
"github.com/break/junhong_cmp_fiber/internal/model/dto"
|
||||
shopCommissionService "github.com/break/junhong_cmp_fiber/internal/service/shop_commission"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/errors"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/response"
|
||||
@@ -20,7 +20,7 @@ func NewShopCommissionHandler(service *shopCommissionService.Service) *ShopCommi
|
||||
}
|
||||
|
||||
func (h *ShopCommissionHandler) ListCommissionSummary(c *fiber.Ctx) error {
|
||||
var req model.ShopCommissionSummaryListReq
|
||||
var req dto.ShopCommissionSummaryListReq
|
||||
if err := c.QueryParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -39,7 +39,7 @@ func (h *ShopCommissionHandler) ListWithdrawalRequests(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的店铺 ID")
|
||||
}
|
||||
|
||||
var req model.ShopWithdrawalRequestListReq
|
||||
var req dto.ShopWithdrawalRequestListReq
|
||||
if err := c.QueryParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
@@ -58,7 +58,7 @@ func (h *ShopCommissionHandler) ListCommissionRecords(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的店铺 ID")
|
||||
}
|
||||
|
||||
var req model.ShopCommissionRecordListReq
|
||||
var req dto.ShopCommissionRecordListReq
|
||||
if err := c.QueryParser(&req); err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "请求参数解析失败")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user