标签更新

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,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,
})