标签更新

This commit is contained in:
2026-01-15 10:44:53 +08:00
parent 2857175266
commit 7ccd3d146c
3 changed files with 33 additions and 33 deletions

View File

@@ -16,35 +16,35 @@ func registerAccountRoutes(api fiber.Router, h *admin.AccountHandler, doc *opena
// 账号 CRUD // 账号 CRUD
Register(accounts, doc, groupPath, "POST", "", h.Create, RouteSpec{ Register(accounts, doc, groupPath, "POST", "", h.Create, RouteSpec{
Summary: "创建账号", Summary: "创建账号",
Tags: []string{"Account"}, Tags: []string{"账号相关"},
Input: new(model.CreateAccountRequest), Input: new(model.CreateAccountRequest),
Output: new(model.AccountResponse), Output: new(model.AccountResponse),
}) })
Register(accounts, doc, groupPath, "GET", "", h.List, RouteSpec{ Register(accounts, doc, groupPath, "GET", "", h.List, RouteSpec{
Summary: "账号列表", Summary: "账号列表",
Tags: []string{"Account"}, Tags: []string{"账号相关"},
Input: new(model.AccountListRequest), Input: new(model.AccountListRequest),
Output: new(model.AccountPageResult), Output: new(model.AccountPageResult),
}) })
Register(accounts, doc, groupPath, "GET", "/:id", h.Get, RouteSpec{ Register(accounts, doc, groupPath, "GET", "/:id", h.Get, RouteSpec{
Summary: "获取账号详情", Summary: "获取账号详情",
Tags: []string{"Account"}, Tags: []string{"账号相关"},
Input: new(model.IDReq), Input: new(model.IDReq),
Output: new(model.AccountResponse), Output: new(model.AccountResponse),
}) })
Register(accounts, doc, groupPath, "PUT", "/:id", h.Update, RouteSpec{ Register(accounts, doc, groupPath, "PUT", "/:id", h.Update, RouteSpec{
Summary: "更新账号", Summary: "更新账号",
Tags: []string{"Account"}, Tags: []string{"账号相关"},
Input: new(model.UpdateAccountParams), Input: new(model.UpdateAccountParams),
Output: new(model.AccountResponse), Output: new(model.AccountResponse),
}) })
Register(accounts, doc, groupPath, "DELETE", "/:id", h.Delete, RouteSpec{ Register(accounts, doc, groupPath, "DELETE", "/:id", h.Delete, RouteSpec{
Summary: "删除账号", Summary: "删除账号",
Tags: []string{"Account"}, Tags: []string{"账号相关"},
Input: new(model.IDReq), Input: new(model.IDReq),
Output: nil, Output: nil,
}) })
@@ -52,21 +52,21 @@ func registerAccountRoutes(api fiber.Router, h *admin.AccountHandler, doc *opena
// 账号-角色关联 // 账号-角色关联
Register(accounts, doc, groupPath, "POST", "/:id/roles", h.AssignRoles, RouteSpec{ Register(accounts, doc, groupPath, "POST", "/:id/roles", h.AssignRoles, RouteSpec{
Summary: "分配角色", Summary: "分配角色",
Tags: []string{"Account"}, Tags: []string{"账号相关"},
Input: new(model.AssignRolesParams), Input: new(model.AssignRolesParams),
Output: nil, // TODO: Define AccountRole response DTO Output: nil, // TODO: Define AccountRole response DTO
}) })
Register(accounts, doc, groupPath, "GET", "/:id/roles", h.GetRoles, RouteSpec{ Register(accounts, doc, groupPath, "GET", "/:id/roles", h.GetRoles, RouteSpec{
Summary: "获取账号角色", Summary: "获取账号角色",
Tags: []string{"Account"}, Tags: []string{"账号相关"},
Input: new(model.IDReq), Input: new(model.IDReq),
Output: new([]model.Role), Output: new([]model.Role),
}) })
Register(accounts, doc, groupPath, "DELETE", "/:account_id/roles/:role_id", h.RemoveRole, RouteSpec{ Register(accounts, doc, groupPath, "DELETE", "/:account_id/roles/:role_id", h.RemoveRole, RouteSpec{
Summary: "移除角色", Summary: "移除角色",
Tags: []string{"Account"}, Tags: []string{"账号相关"},
Input: new(model.RemoveRoleParams), Input: new(model.RemoveRoleParams),
Output: nil, Output: nil,
}) })
@@ -80,70 +80,70 @@ func registerPlatformAccountRoutes(api fiber.Router, h *admin.AccountHandler, do
Register(platformAccounts, doc, groupPath, "GET", "", h.ListPlatformAccounts, RouteSpec{ Register(platformAccounts, doc, groupPath, "GET", "", h.ListPlatformAccounts, RouteSpec{
Summary: "平台账号列表", Summary: "平台账号列表",
Tags: []string{"PlatformAccount"}, Tags: []string{"平台账号"},
Input: new(model.PlatformAccountListRequest), Input: new(model.PlatformAccountListRequest),
Output: new(model.AccountPageResult), Output: new(model.AccountPageResult),
}) })
Register(platformAccounts, doc, groupPath, "POST", "", h.Create, RouteSpec{ Register(platformAccounts, doc, groupPath, "POST", "", h.Create, RouteSpec{
Summary: "新增平台账号", Summary: "新增平台账号",
Tags: []string{"PlatformAccount"}, Tags: []string{"平台账号"},
Input: new(model.CreateAccountRequest), Input: new(model.CreateAccountRequest),
Output: new(model.AccountResponse), Output: new(model.AccountResponse),
}) })
Register(platformAccounts, doc, groupPath, "GET", "/:id", h.Get, RouteSpec{ Register(platformAccounts, doc, groupPath, "GET", "/:id", h.Get, RouteSpec{
Summary: "获取平台账号详情", Summary: "获取平台账号详情",
Tags: []string{"PlatformAccount"}, Tags: []string{"平台账号"},
Input: new(model.IDReq), Input: new(model.IDReq),
Output: new(model.AccountResponse), Output: new(model.AccountResponse),
}) })
Register(platformAccounts, doc, groupPath, "PUT", "/:id", h.Update, RouteSpec{ Register(platformAccounts, doc, groupPath, "PUT", "/:id", h.Update, RouteSpec{
Summary: "编辑平台账号", Summary: "编辑平台账号",
Tags: []string{"PlatformAccount"}, Tags: []string{"平台账号"},
Input: new(model.UpdateAccountParams), Input: new(model.UpdateAccountParams),
Output: new(model.AccountResponse), Output: new(model.AccountResponse),
}) })
Register(platformAccounts, doc, groupPath, "DELETE", "/:id", h.Delete, RouteSpec{ Register(platformAccounts, doc, groupPath, "DELETE", "/:id", h.Delete, RouteSpec{
Summary: "删除平台账号", Summary: "删除平台账号",
Tags: []string{"PlatformAccount"}, Tags: []string{"平台账号"},
Input: new(model.IDReq), Input: new(model.IDReq),
Output: nil, Output: nil,
}) })
Register(platformAccounts, doc, groupPath, "PUT", "/:id/password", h.UpdatePassword, RouteSpec{ Register(platformAccounts, doc, groupPath, "PUT", "/:id/password", h.UpdatePassword, RouteSpec{
Summary: "修改密码", Summary: "修改密码",
Tags: []string{"PlatformAccount"}, Tags: []string{"平台账号"},
Input: new(model.UpdatePasswordParams), Input: new(model.UpdatePasswordParams),
Output: nil, Output: nil,
}) })
Register(platformAccounts, doc, groupPath, "PUT", "/:id/status", h.UpdateStatus, RouteSpec{ Register(platformAccounts, doc, groupPath, "PUT", "/:id/status", h.UpdateStatus, RouteSpec{
Summary: "启用/禁用账号", Summary: "启用/禁用账号",
Tags: []string{"PlatformAccount"}, Tags: []string{"平台账号"},
Input: new(model.UpdateStatusParams), Input: new(model.UpdateStatusParams),
Output: nil, Output: nil,
}) })
Register(platformAccounts, doc, groupPath, "POST", "/:id/roles", h.AssignRoles, RouteSpec{ Register(platformAccounts, doc, groupPath, "POST", "/:id/roles", h.AssignRoles, RouteSpec{
Summary: "分配角色", Summary: "分配角色",
Tags: []string{"PlatformAccount"}, Tags: []string{"平台账号"},
Input: new(model.AssignRolesParams), Input: new(model.AssignRolesParams),
Output: nil, Output: nil,
}) })
Register(platformAccounts, doc, groupPath, "GET", "/:id/roles", h.GetRoles, RouteSpec{ Register(platformAccounts, doc, groupPath, "GET", "/:id/roles", h.GetRoles, RouteSpec{
Summary: "获取账号角色", Summary: "获取账号角色",
Tags: []string{"PlatformAccount"}, Tags: []string{"平台账号"},
Input: new(model.IDReq), Input: new(model.IDReq),
Output: new([]model.Role), Output: new([]model.Role),
}) })
Register(platformAccounts, doc, groupPath, "DELETE", "/:account_id/roles/:role_id", h.RemoveRole, RouteSpec{ Register(platformAccounts, doc, groupPath, "DELETE", "/:account_id/roles/:role_id", h.RemoveRole, RouteSpec{
Summary: "移除角色", Summary: "移除角色",
Tags: []string{"PlatformAccount"}, Tags: []string{"平台账号"},
Input: new(model.RemoveRoleParams), Input: new(model.RemoveRoleParams),
Output: nil, Output: nil,
}) })

View File

@@ -16,42 +16,42 @@ func registerPermissionRoutes(api fiber.Router, h *admin.PermissionHandler, doc
// 权限 CRUD // 权限 CRUD
Register(permissions, doc, groupPath, "POST", "", h.Create, RouteSpec{ Register(permissions, doc, groupPath, "POST", "", h.Create, RouteSpec{
Summary: "创建权限", Summary: "创建权限",
Tags: []string{"Permission"}, Tags: []string{"权限"},
Input: new(model.CreatePermissionRequest), Input: new(model.CreatePermissionRequest),
Output: new(model.PermissionResponse), Output: new(model.PermissionResponse),
}) })
Register(permissions, doc, groupPath, "GET", "", h.List, RouteSpec{ Register(permissions, doc, groupPath, "GET", "", h.List, RouteSpec{
Summary: "权限列表", Summary: "权限列表",
Tags: []string{"Permission"}, Tags: []string{"权限"},
Input: new(model.PermissionListRequest), Input: new(model.PermissionListRequest),
Output: new(model.PermissionPageResult), Output: new(model.PermissionPageResult),
}) })
Register(permissions, doc, groupPath, "GET", "/tree", h.GetTree, RouteSpec{ Register(permissions, doc, groupPath, "GET", "/tree", h.GetTree, RouteSpec{
Summary: "获取权限树", Summary: "获取权限树",
Tags: []string{"Permission"}, Tags: []string{"权限"},
Input: nil, // 无参数或 Query 参数 Input: nil, // 无参数或 Query 参数
Output: new([]*model.PermissionTreeNode), Output: new([]*model.PermissionTreeNode),
}) })
Register(permissions, doc, groupPath, "GET", "/:id", h.Get, RouteSpec{ Register(permissions, doc, groupPath, "GET", "/:id", h.Get, RouteSpec{
Summary: "获取权限详情", Summary: "获取权限详情",
Tags: []string{"Permission"}, Tags: []string{"权限"},
Input: new(model.IDReq), Input: new(model.IDReq),
Output: new(model.PermissionResponse), Output: new(model.PermissionResponse),
}) })
Register(permissions, doc, groupPath, "PUT", "/:id", h.Update, RouteSpec{ Register(permissions, doc, groupPath, "PUT", "/:id", h.Update, RouteSpec{
Summary: "更新权限", Summary: "更新权限",
Tags: []string{"Permission"}, Tags: []string{"权限"},
Input: new(model.UpdatePermissionParams), Input: new(model.UpdatePermissionParams),
Output: new(model.PermissionResponse), Output: new(model.PermissionResponse),
}) })
Register(permissions, doc, groupPath, "DELETE", "/:id", h.Delete, RouteSpec{ Register(permissions, doc, groupPath, "DELETE", "/:id", h.Delete, RouteSpec{
Summary: "删除权限", Summary: "删除权限",
Tags: []string{"Permission"}, Tags: []string{"权限"},
Input: new(model.IDReq), Input: new(model.IDReq),
Output: nil, Output: nil,
}) })

View File

@@ -16,42 +16,42 @@ func registerRoleRoutes(api fiber.Router, h *admin.RoleHandler, doc *openapi.Gen
// 角色 CRUD // 角色 CRUD
Register(roles, doc, groupPath, "POST", "", h.Create, RouteSpec{ Register(roles, doc, groupPath, "POST", "", h.Create, RouteSpec{
Summary: "创建角色", Summary: "创建角色",
Tags: []string{"Role"}, Tags: []string{"角色"},
Input: new(model.CreateRoleRequest), Input: new(model.CreateRoleRequest),
Output: new(model.RoleResponse), Output: new(model.RoleResponse),
}) })
Register(roles, doc, groupPath, "GET", "", h.List, RouteSpec{ Register(roles, doc, groupPath, "GET", "", h.List, RouteSpec{
Summary: "角色列表", Summary: "角色列表",
Tags: []string{"Role"}, Tags: []string{"角色"},
Input: new(model.RoleListRequest), Input: new(model.RoleListRequest),
Output: new(model.RolePageResult), Output: new(model.RolePageResult),
}) })
Register(roles, doc, groupPath, "GET", "/:id", h.Get, RouteSpec{ Register(roles, doc, groupPath, "GET", "/:id", h.Get, RouteSpec{
Summary: "获取角色详情", Summary: "获取角色详情",
Tags: []string{"Role"}, Tags: []string{"角色"},
Input: new(model.IDReq), Input: new(model.IDReq),
Output: new(model.RoleResponse), Output: new(model.RoleResponse),
}) })
Register(roles, doc, groupPath, "PUT", "/:id", h.Update, RouteSpec{ Register(roles, doc, groupPath, "PUT", "/:id", h.Update, RouteSpec{
Summary: "更新角色", Summary: "更新角色",
Tags: []string{"Role"}, Tags: []string{"角色"},
Input: new(model.UpdateRoleParams), Input: new(model.UpdateRoleParams),
Output: new(model.RoleResponse), Output: new(model.RoleResponse),
}) })
Register(roles, doc, groupPath, "PUT", "/:id/status", h.UpdateStatus, RouteSpec{ Register(roles, doc, groupPath, "PUT", "/:id/status", h.UpdateStatus, RouteSpec{
Summary: "更新角色状态", Summary: "更新角色状态",
Tags: []string{"Role"}, Tags: []string{"角色"},
Input: new(model.UpdateRoleStatusParams), Input: new(model.UpdateRoleStatusParams),
Output: nil, Output: nil,
}) })
Register(roles, doc, groupPath, "DELETE", "/:id", h.Delete, RouteSpec{ Register(roles, doc, groupPath, "DELETE", "/:id", h.Delete, RouteSpec{
Summary: "删除角色", Summary: "删除角色",
Tags: []string{"Role"}, Tags: []string{"角色"},
Input: new(model.IDReq), Input: new(model.IDReq),
Output: nil, Output: nil,
}) })
@@ -59,21 +59,21 @@ func registerRoleRoutes(api fiber.Router, h *admin.RoleHandler, doc *openapi.Gen
// 角色-权限关联 // 角色-权限关联
Register(roles, doc, groupPath, "POST", "/:id/permissions", h.AssignPermissions, RouteSpec{ Register(roles, doc, groupPath, "POST", "/:id/permissions", h.AssignPermissions, RouteSpec{
Summary: "分配权限", Summary: "分配权限",
Tags: []string{"Role"}, Tags: []string{"角色"},
Input: new(model.AssignPermissionsParams), Input: new(model.AssignPermissionsParams),
Output: nil, Output: nil,
}) })
Register(roles, doc, groupPath, "GET", "/:id/permissions", h.GetPermissions, RouteSpec{ Register(roles, doc, groupPath, "GET", "/:id/permissions", h.GetPermissions, RouteSpec{
Summary: "获取角色权限", Summary: "获取角色权限",
Tags: []string{"Role"}, Tags: []string{"角色"},
Input: new(model.IDReq), Input: new(model.IDReq),
Output: new([]model.Permission), Output: new([]model.Permission),
}) })
Register(roles, doc, groupPath, "DELETE", "/:role_id/permissions/:perm_id", h.RemovePermission, RouteSpec{ Register(roles, doc, groupPath, "DELETE", "/:role_id/permissions/:perm_id", h.RemovePermission, RouteSpec{
Summary: "移除权限", Summary: "移除权限",
Tags: []string{"Role"}, Tags: []string{"角色"},
Input: new(model.RemovePermissionParams), Input: new(model.RemovePermissionParams),
Output: nil, Output: nil,
}) })