feat(role): 新增平台角色管理功能增强
- 权限表增加 available_for_role_types 字段,支持标记权限可用角色类型 - 权限列表和权限树接口支持按 available_for_role_type 过滤 - 新增角色状态切换接口 PUT /api/admin/roles/:id/status - 角色分配权限时验证权限的可用角色类型 - 完善数据库迁移脚本和单元测试 - 补充数据库迁移相关开发规范文档
This commit is contained in:
@@ -66,3 +66,14 @@ type RemovePermissionParams struct {
|
||||
RoleID uint `path:"role_id" required:"true" description:"角色ID"`
|
||||
PermID uint `path:"perm_id" required:"true" description:"权限ID"`
|
||||
}
|
||||
|
||||
// UpdateRoleStatusRequest 更新角色状态请求
|
||||
type UpdateRoleStatusRequest struct {
|
||||
Status int `json:"status" validate:"required,min=0,max=1" required:"true" minimum:"0" maximum:"1" description:"状态 (0:禁用, 1:启用)"`
|
||||
}
|
||||
|
||||
// UpdateRoleStatusParams 更新角色状态参数聚合
|
||||
type UpdateRoleStatusParams struct {
|
||||
IDReq
|
||||
UpdateRoleStatusRequest
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user