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:
@@ -5,6 +5,7 @@ import (
|
||||
|
||||
"github.com/break/junhong_cmp_fiber/internal/handler/admin"
|
||||
"github.com/break/junhong_cmp_fiber/internal/model"
|
||||
"github.com/break/junhong_cmp_fiber/internal/model/dto"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/openapi"
|
||||
)
|
||||
|
||||
@@ -17,39 +18,39 @@ func registerAccountRoutes(api fiber.Router, h *admin.AccountHandler, doc *opena
|
||||
Register(accounts, doc, groupPath, "POST", "", h.Create, RouteSpec{
|
||||
Summary: "创建账号",
|
||||
Tags: []string{"账号相关"},
|
||||
Input: new(model.CreateAccountRequest),
|
||||
Output: new(model.AccountResponse),
|
||||
Input: new(dto.CreateAccountRequest),
|
||||
Output: new(dto.AccountResponse),
|
||||
Auth: true,
|
||||
})
|
||||
|
||||
Register(accounts, doc, groupPath, "GET", "", h.List, RouteSpec{
|
||||
Summary: "账号列表",
|
||||
Tags: []string{"账号相关"},
|
||||
Input: new(model.AccountListRequest),
|
||||
Output: new(model.AccountPageResult),
|
||||
Input: new(dto.AccountListRequest),
|
||||
Output: new(dto.AccountPageResult),
|
||||
Auth: true,
|
||||
})
|
||||
|
||||
Register(accounts, doc, groupPath, "GET", "/:id", h.Get, RouteSpec{
|
||||
Summary: "获取账号详情",
|
||||
Tags: []string{"账号相关"},
|
||||
Input: new(model.IDReq),
|
||||
Output: new(model.AccountResponse),
|
||||
Input: new(dto.IDReq),
|
||||
Output: new(dto.AccountResponse),
|
||||
Auth: true,
|
||||
})
|
||||
|
||||
Register(accounts, doc, groupPath, "PUT", "/:id", h.Update, RouteSpec{
|
||||
Summary: "更新账号",
|
||||
Tags: []string{"账号相关"},
|
||||
Input: new(model.UpdateAccountParams),
|
||||
Output: new(model.AccountResponse),
|
||||
Input: new(dto.UpdateAccountParams),
|
||||
Output: new(dto.AccountResponse),
|
||||
Auth: true,
|
||||
})
|
||||
|
||||
Register(accounts, doc, groupPath, "DELETE", "/:id", h.Delete, RouteSpec{
|
||||
Summary: "删除账号",
|
||||
Tags: []string{"账号相关"},
|
||||
Input: new(model.IDReq),
|
||||
Input: new(dto.IDReq),
|
||||
Output: nil,
|
||||
Auth: true,
|
||||
})
|
||||
@@ -58,14 +59,14 @@ func registerAccountRoutes(api fiber.Router, h *admin.AccountHandler, doc *opena
|
||||
Register(accounts, doc, groupPath, "POST", "/:id/roles", h.AssignRoles, RouteSpec{
|
||||
Summary: "分配角色",
|
||||
Tags: []string{"账号相关"},
|
||||
Input: new(model.AssignRolesParams),
|
||||
Input: new(dto.AssignRolesParams),
|
||||
Output: nil, // TODO: Define AccountRole response DTO
|
||||
})
|
||||
|
||||
Register(accounts, doc, groupPath, "GET", "/:id/roles", h.GetRoles, RouteSpec{
|
||||
Summary: "获取账号角色",
|
||||
Tags: []string{"账号相关"},
|
||||
Input: new(model.IDReq),
|
||||
Input: new(dto.IDReq),
|
||||
Output: new([]model.Role),
|
||||
Auth: true,
|
||||
})
|
||||
@@ -73,7 +74,7 @@ func registerAccountRoutes(api fiber.Router, h *admin.AccountHandler, doc *opena
|
||||
Register(accounts, doc, groupPath, "DELETE", "/:account_id/roles/:role_id", h.RemoveRole, RouteSpec{
|
||||
Summary: "移除角色",
|
||||
Tags: []string{"账号相关"},
|
||||
Input: new(model.RemoveRoleParams),
|
||||
Input: new(dto.RemoveRoleParams),
|
||||
Output: nil,
|
||||
Auth: true,
|
||||
})
|
||||
@@ -88,39 +89,39 @@ func registerPlatformAccountRoutes(api fiber.Router, h *admin.AccountHandler, do
|
||||
Register(platformAccounts, doc, groupPath, "GET", "", h.ListPlatformAccounts, RouteSpec{
|
||||
Summary: "平台账号列表",
|
||||
Tags: []string{"平台账号"},
|
||||
Input: new(model.PlatformAccountListRequest),
|
||||
Output: new(model.AccountPageResult),
|
||||
Input: new(dto.PlatformAccountListRequest),
|
||||
Output: new(dto.AccountPageResult),
|
||||
Auth: true,
|
||||
})
|
||||
|
||||
Register(platformAccounts, doc, groupPath, "POST", "", h.Create, RouteSpec{
|
||||
Summary: "新增平台账号",
|
||||
Tags: []string{"平台账号"},
|
||||
Input: new(model.CreateAccountRequest),
|
||||
Output: new(model.AccountResponse),
|
||||
Input: new(dto.CreateAccountRequest),
|
||||
Output: new(dto.AccountResponse),
|
||||
Auth: true,
|
||||
})
|
||||
|
||||
Register(platformAccounts, doc, groupPath, "GET", "/:id", h.Get, RouteSpec{
|
||||
Summary: "获取平台账号详情",
|
||||
Tags: []string{"平台账号"},
|
||||
Input: new(model.IDReq),
|
||||
Output: new(model.AccountResponse),
|
||||
Input: new(dto.IDReq),
|
||||
Output: new(dto.AccountResponse),
|
||||
Auth: true,
|
||||
})
|
||||
|
||||
Register(platformAccounts, doc, groupPath, "PUT", "/:id", h.Update, RouteSpec{
|
||||
Summary: "编辑平台账号",
|
||||
Tags: []string{"平台账号"},
|
||||
Input: new(model.UpdateAccountParams),
|
||||
Output: new(model.AccountResponse),
|
||||
Input: new(dto.UpdateAccountParams),
|
||||
Output: new(dto.AccountResponse),
|
||||
Auth: true,
|
||||
})
|
||||
|
||||
Register(platformAccounts, doc, groupPath, "DELETE", "/:id", h.Delete, RouteSpec{
|
||||
Summary: "删除平台账号",
|
||||
Tags: []string{"平台账号"},
|
||||
Input: new(model.IDReq),
|
||||
Input: new(dto.IDReq),
|
||||
Output: nil,
|
||||
Auth: true,
|
||||
})
|
||||
@@ -128,7 +129,7 @@ func registerPlatformAccountRoutes(api fiber.Router, h *admin.AccountHandler, do
|
||||
Register(platformAccounts, doc, groupPath, "PUT", "/:id/password", h.UpdatePassword, RouteSpec{
|
||||
Summary: "修改密码",
|
||||
Tags: []string{"平台账号"},
|
||||
Input: new(model.UpdatePasswordParams),
|
||||
Input: new(dto.UpdatePasswordParams),
|
||||
Output: nil,
|
||||
Auth: true,
|
||||
})
|
||||
@@ -136,7 +137,7 @@ func registerPlatformAccountRoutes(api fiber.Router, h *admin.AccountHandler, do
|
||||
Register(platformAccounts, doc, groupPath, "PUT", "/:id/status", h.UpdateStatus, RouteSpec{
|
||||
Summary: "启用/禁用账号",
|
||||
Tags: []string{"平台账号"},
|
||||
Input: new(model.UpdateStatusParams),
|
||||
Input: new(dto.UpdateStatusParams),
|
||||
Output: nil,
|
||||
Auth: true,
|
||||
})
|
||||
@@ -144,7 +145,7 @@ func registerPlatformAccountRoutes(api fiber.Router, h *admin.AccountHandler, do
|
||||
Register(platformAccounts, doc, groupPath, "POST", "/:id/roles", h.AssignRoles, RouteSpec{
|
||||
Summary: "分配角色",
|
||||
Tags: []string{"平台账号"},
|
||||
Input: new(model.AssignRolesParams),
|
||||
Input: new(dto.AssignRolesParams),
|
||||
Output: nil,
|
||||
Auth: true,
|
||||
})
|
||||
@@ -152,7 +153,7 @@ func registerPlatformAccountRoutes(api fiber.Router, h *admin.AccountHandler, do
|
||||
Register(platformAccounts, doc, groupPath, "GET", "/:id/roles", h.GetRoles, RouteSpec{
|
||||
Summary: "获取账号角色",
|
||||
Tags: []string{"平台账号"},
|
||||
Input: new(model.IDReq),
|
||||
Input: new(dto.IDReq),
|
||||
Output: new([]model.Role),
|
||||
Auth: true,
|
||||
})
|
||||
@@ -160,7 +161,7 @@ func registerPlatformAccountRoutes(api fiber.Router, h *admin.AccountHandler, do
|
||||
Register(platformAccounts, doc, groupPath, "DELETE", "/:account_id/roles/:role_id", h.RemoveRole, RouteSpec{
|
||||
Summary: "移除角色",
|
||||
Tags: []string{"平台账号"},
|
||||
Input: new(model.RemoveRoleParams),
|
||||
Input: new(dto.RemoveRoleParams),
|
||||
Output: nil,
|
||||
Auth: true,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user