标签更新
This commit is contained in:
@@ -16,35 +16,35 @@ func registerAccountRoutes(api fiber.Router, h *admin.AccountHandler, doc *opena
|
||||
// 账号 CRUD
|
||||
Register(accounts, doc, groupPath, "POST", "", h.Create, RouteSpec{
|
||||
Summary: "创建账号",
|
||||
Tags: []string{"Account"},
|
||||
Tags: []string{"账号相关"},
|
||||
Input: new(model.CreateAccountRequest),
|
||||
Output: new(model.AccountResponse),
|
||||
})
|
||||
|
||||
Register(accounts, doc, groupPath, "GET", "", h.List, RouteSpec{
|
||||
Summary: "账号列表",
|
||||
Tags: []string{"Account"},
|
||||
Tags: []string{"账号相关"},
|
||||
Input: new(model.AccountListRequest),
|
||||
Output: new(model.AccountPageResult),
|
||||
})
|
||||
|
||||
Register(accounts, doc, groupPath, "GET", "/:id", h.Get, RouteSpec{
|
||||
Summary: "获取账号详情",
|
||||
Tags: []string{"Account"},
|
||||
Tags: []string{"账号相关"},
|
||||
Input: new(model.IDReq),
|
||||
Output: new(model.AccountResponse),
|
||||
})
|
||||
|
||||
Register(accounts, doc, groupPath, "PUT", "/:id", h.Update, RouteSpec{
|
||||
Summary: "更新账号",
|
||||
Tags: []string{"Account"},
|
||||
Tags: []string{"账号相关"},
|
||||
Input: new(model.UpdateAccountParams),
|
||||
Output: new(model.AccountResponse),
|
||||
})
|
||||
|
||||
Register(accounts, doc, groupPath, "DELETE", "/:id", h.Delete, RouteSpec{
|
||||
Summary: "删除账号",
|
||||
Tags: []string{"Account"},
|
||||
Tags: []string{"账号相关"},
|
||||
Input: new(model.IDReq),
|
||||
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{
|
||||
Summary: "分配角色",
|
||||
Tags: []string{"Account"},
|
||||
Tags: []string{"账号相关"},
|
||||
Input: new(model.AssignRolesParams),
|
||||
Output: nil, // TODO: Define AccountRole response DTO
|
||||
})
|
||||
|
||||
Register(accounts, doc, groupPath, "GET", "/:id/roles", h.GetRoles, RouteSpec{
|
||||
Summary: "获取账号角色",
|
||||
Tags: []string{"Account"},
|
||||
Tags: []string{"账号相关"},
|
||||
Input: new(model.IDReq),
|
||||
Output: new([]model.Role),
|
||||
})
|
||||
|
||||
Register(accounts, doc, groupPath, "DELETE", "/:account_id/roles/:role_id", h.RemoveRole, RouteSpec{
|
||||
Summary: "移除角色",
|
||||
Tags: []string{"Account"},
|
||||
Tags: []string{"账号相关"},
|
||||
Input: new(model.RemoveRoleParams),
|
||||
Output: nil,
|
||||
})
|
||||
@@ -80,70 +80,70 @@ func registerPlatformAccountRoutes(api fiber.Router, h *admin.AccountHandler, do
|
||||
|
||||
Register(platformAccounts, doc, groupPath, "GET", "", h.ListPlatformAccounts, RouteSpec{
|
||||
Summary: "平台账号列表",
|
||||
Tags: []string{"PlatformAccount"},
|
||||
Tags: []string{"平台账号"},
|
||||
Input: new(model.PlatformAccountListRequest),
|
||||
Output: new(model.AccountPageResult),
|
||||
})
|
||||
|
||||
Register(platformAccounts, doc, groupPath, "POST", "", h.Create, RouteSpec{
|
||||
Summary: "新增平台账号",
|
||||
Tags: []string{"PlatformAccount"},
|
||||
Tags: []string{"平台账号"},
|
||||
Input: new(model.CreateAccountRequest),
|
||||
Output: new(model.AccountResponse),
|
||||
})
|
||||
|
||||
Register(platformAccounts, doc, groupPath, "GET", "/:id", h.Get, RouteSpec{
|
||||
Summary: "获取平台账号详情",
|
||||
Tags: []string{"PlatformAccount"},
|
||||
Tags: []string{"平台账号"},
|
||||
Input: new(model.IDReq),
|
||||
Output: new(model.AccountResponse),
|
||||
})
|
||||
|
||||
Register(platformAccounts, doc, groupPath, "PUT", "/:id", h.Update, RouteSpec{
|
||||
Summary: "编辑平台账号",
|
||||
Tags: []string{"PlatformAccount"},
|
||||
Tags: []string{"平台账号"},
|
||||
Input: new(model.UpdateAccountParams),
|
||||
Output: new(model.AccountResponse),
|
||||
})
|
||||
|
||||
Register(platformAccounts, doc, groupPath, "DELETE", "/:id", h.Delete, RouteSpec{
|
||||
Summary: "删除平台账号",
|
||||
Tags: []string{"PlatformAccount"},
|
||||
Tags: []string{"平台账号"},
|
||||
Input: new(model.IDReq),
|
||||
Output: nil,
|
||||
})
|
||||
|
||||
Register(platformAccounts, doc, groupPath, "PUT", "/:id/password", h.UpdatePassword, RouteSpec{
|
||||
Summary: "修改密码",
|
||||
Tags: []string{"PlatformAccount"},
|
||||
Tags: []string{"平台账号"},
|
||||
Input: new(model.UpdatePasswordParams),
|
||||
Output: nil,
|
||||
})
|
||||
|
||||
Register(platformAccounts, doc, groupPath, "PUT", "/:id/status", h.UpdateStatus, RouteSpec{
|
||||
Summary: "启用/禁用账号",
|
||||
Tags: []string{"PlatformAccount"},
|
||||
Tags: []string{"平台账号"},
|
||||
Input: new(model.UpdateStatusParams),
|
||||
Output: nil,
|
||||
})
|
||||
|
||||
Register(platformAccounts, doc, groupPath, "POST", "/:id/roles", h.AssignRoles, RouteSpec{
|
||||
Summary: "分配角色",
|
||||
Tags: []string{"PlatformAccount"},
|
||||
Tags: []string{"平台账号"},
|
||||
Input: new(model.AssignRolesParams),
|
||||
Output: nil,
|
||||
})
|
||||
|
||||
Register(platformAccounts, doc, groupPath, "GET", "/:id/roles", h.GetRoles, RouteSpec{
|
||||
Summary: "获取账号角色",
|
||||
Tags: []string{"PlatformAccount"},
|
||||
Tags: []string{"平台账号"},
|
||||
Input: new(model.IDReq),
|
||||
Output: new([]model.Role),
|
||||
})
|
||||
|
||||
Register(platformAccounts, doc, groupPath, "DELETE", "/:account_id/roles/:role_id", h.RemoveRole, RouteSpec{
|
||||
Summary: "移除角色",
|
||||
Tags: []string{"PlatformAccount"},
|
||||
Tags: []string{"平台账号"},
|
||||
Input: new(model.RemoveRoleParams),
|
||||
Output: nil,
|
||||
})
|
||||
|
||||
@@ -16,42 +16,42 @@ func registerPermissionRoutes(api fiber.Router, h *admin.PermissionHandler, doc
|
||||
// 权限 CRUD
|
||||
Register(permissions, doc, groupPath, "POST", "", h.Create, RouteSpec{
|
||||
Summary: "创建权限",
|
||||
Tags: []string{"Permission"},
|
||||
Tags: []string{"权限"},
|
||||
Input: new(model.CreatePermissionRequest),
|
||||
Output: new(model.PermissionResponse),
|
||||
})
|
||||
|
||||
Register(permissions, doc, groupPath, "GET", "", h.List, RouteSpec{
|
||||
Summary: "权限列表",
|
||||
Tags: []string{"Permission"},
|
||||
Tags: []string{"权限"},
|
||||
Input: new(model.PermissionListRequest),
|
||||
Output: new(model.PermissionPageResult),
|
||||
})
|
||||
|
||||
Register(permissions, doc, groupPath, "GET", "/tree", h.GetTree, RouteSpec{
|
||||
Summary: "获取权限树",
|
||||
Tags: []string{"Permission"},
|
||||
Tags: []string{"权限"},
|
||||
Input: nil, // 无参数或 Query 参数
|
||||
Output: new([]*model.PermissionTreeNode),
|
||||
})
|
||||
|
||||
Register(permissions, doc, groupPath, "GET", "/:id", h.Get, RouteSpec{
|
||||
Summary: "获取权限详情",
|
||||
Tags: []string{"Permission"},
|
||||
Tags: []string{"权限"},
|
||||
Input: new(model.IDReq),
|
||||
Output: new(model.PermissionResponse),
|
||||
})
|
||||
|
||||
Register(permissions, doc, groupPath, "PUT", "/:id", h.Update, RouteSpec{
|
||||
Summary: "更新权限",
|
||||
Tags: []string{"Permission"},
|
||||
Tags: []string{"权限"},
|
||||
Input: new(model.UpdatePermissionParams),
|
||||
Output: new(model.PermissionResponse),
|
||||
})
|
||||
|
||||
Register(permissions, doc, groupPath, "DELETE", "/:id", h.Delete, RouteSpec{
|
||||
Summary: "删除权限",
|
||||
Tags: []string{"Permission"},
|
||||
Tags: []string{"权限"},
|
||||
Input: new(model.IDReq),
|
||||
Output: nil,
|
||||
})
|
||||
|
||||
@@ -16,42 +16,42 @@ func registerRoleRoutes(api fiber.Router, h *admin.RoleHandler, doc *openapi.Gen
|
||||
// 角色 CRUD
|
||||
Register(roles, doc, groupPath, "POST", "", h.Create, RouteSpec{
|
||||
Summary: "创建角色",
|
||||
Tags: []string{"Role"},
|
||||
Tags: []string{"角色"},
|
||||
Input: new(model.CreateRoleRequest),
|
||||
Output: new(model.RoleResponse),
|
||||
})
|
||||
|
||||
Register(roles, doc, groupPath, "GET", "", h.List, RouteSpec{
|
||||
Summary: "角色列表",
|
||||
Tags: []string{"Role"},
|
||||
Tags: []string{"角色"},
|
||||
Input: new(model.RoleListRequest),
|
||||
Output: new(model.RolePageResult),
|
||||
})
|
||||
|
||||
Register(roles, doc, groupPath, "GET", "/:id", h.Get, RouteSpec{
|
||||
Summary: "获取角色详情",
|
||||
Tags: []string{"Role"},
|
||||
Tags: []string{"角色"},
|
||||
Input: new(model.IDReq),
|
||||
Output: new(model.RoleResponse),
|
||||
})
|
||||
|
||||
Register(roles, doc, groupPath, "PUT", "/:id", h.Update, RouteSpec{
|
||||
Summary: "更新角色",
|
||||
Tags: []string{"Role"},
|
||||
Tags: []string{"角色"},
|
||||
Input: new(model.UpdateRoleParams),
|
||||
Output: new(model.RoleResponse),
|
||||
})
|
||||
|
||||
Register(roles, doc, groupPath, "PUT", "/:id/status", h.UpdateStatus, RouteSpec{
|
||||
Summary: "更新角色状态",
|
||||
Tags: []string{"Role"},
|
||||
Tags: []string{"角色"},
|
||||
Input: new(model.UpdateRoleStatusParams),
|
||||
Output: nil,
|
||||
})
|
||||
|
||||
Register(roles, doc, groupPath, "DELETE", "/:id", h.Delete, RouteSpec{
|
||||
Summary: "删除角色",
|
||||
Tags: []string{"Role"},
|
||||
Tags: []string{"角色"},
|
||||
Input: new(model.IDReq),
|
||||
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{
|
||||
Summary: "分配权限",
|
||||
Tags: []string{"Role"},
|
||||
Tags: []string{"角色"},
|
||||
Input: new(model.AssignPermissionsParams),
|
||||
Output: nil,
|
||||
})
|
||||
|
||||
Register(roles, doc, groupPath, "GET", "/:id/permissions", h.GetPermissions, RouteSpec{
|
||||
Summary: "获取角色权限",
|
||||
Tags: []string{"Role"},
|
||||
Tags: []string{"角色"},
|
||||
Input: new(model.IDReq),
|
||||
Output: new([]model.Permission),
|
||||
})
|
||||
|
||||
Register(roles, doc, groupPath, "DELETE", "/:role_id/permissions/:perm_id", h.RemovePermission, RouteSpec{
|
||||
Summary: "移除权限",
|
||||
Tags: []string{"Role"},
|
||||
Tags: []string{"角色"},
|
||||
Input: new(model.RemovePermissionParams),
|
||||
Output: nil,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user