feat: rbac完善,file接入完成

This commit is contained in:
Blizzard
2026-05-01 12:56:08 +08:00
parent bbd3f834b9
commit a93477ea8e
81 changed files with 5470 additions and 371 deletions
+51 -11
View File
@@ -12,6 +12,9 @@ type (
IdReq {
Id string `json:"id"`
}
IdQueryReq {
Id string `form:"id"`
}
IdsReq {
Ids []string `json:"ids"`
}
@@ -49,17 +52,27 @@ type (
MenuIds []string `json:"menuIds,optional"`
}
RoleUpdateReq {
Id string `json:"id"`
Name string `json:"name,optional"`
Code string `json:"code,optional"`
Sort int `json:"sort,optional"`
MenuIds []string `json:"menuIds,optional"`
Id string `json:"id"`
Name string `json:"name,optional"`
Code string `json:"code,optional"`
Sort int `json:"sort,optional"`
}
RoleListReq {
Current int `json:"current,optional"`
PageSize int `json:"pageSize,optional"`
Name string `json:"name,optional"`
}
RoleDetailResp {
Id string `json:"id"`
Name string `json:"name"`
Code string `json:"code"`
Sort int `json:"sort"`
MenuIds []string `json:"menuIds"`
}
AssignRoleMenusReq {
RoleId string `json:"roleId"`
MenuIds []string `json:"menuIds"`
}
// ---------- 菜单 ----------
MenuReq {
ParentId string `json:"parentId,optional"`
@@ -125,12 +138,11 @@ type (
RoleIds []string `json:"roleIds,optional"`
}
UserUpdateReq {
Id string `json:"id"`
Name string `json:"name,optional"`
Account string `json:"account,optional"`
Phone string `json:"phone,optional"`
NickName string `json:"nickName,optional"`
RoleIds []string `json:"roleIds,optional"`
Id string `json:"id"`
Name string `json:"name,optional"`
Account string `json:"account,optional"`
Phone string `json:"phone,optional"`
NickName string `json:"nickName,optional"`
}
UserListReq {
Current int `json:"current,optional"`
@@ -138,10 +150,22 @@ type (
Name string `json:"name,optional"`
Account string `json:"account,optional"`
}
UserDetailResp {
Id string `json:"id"`
Name string `json:"name"`
Account string `json:"account"`
NickName string `json:"nickName"`
Phone string `json:"phone"`
RoleIds []string `json:"roleIds"`
}
ResetPasswordReq {
Id string `json:"id"`
Password string `json:"password"`
}
AssignUserRolesReq {
UserId string `json:"userId"`
RoleIds []string `json:"roleIds"`
}
)
// ========== 需要鉴权的接口 ==========
@@ -189,6 +213,14 @@ service system-api {
@doc "角色列表"
@handler GetRoleList
post /role/list (RoleListReq)
@doc "角色详情(含已授权菜单)"
@handler GetRoleDetail
get /role/detail (IdQueryReq) returns (RoleDetailResp)
@doc "角色授权菜单"
@handler AssignRoleMenus
post /role/assignMenus (AssignRoleMenusReq)
}
@server (
@@ -266,6 +298,10 @@ service system-api {
@handler GetUserList
post /user/list (UserListReq)
@doc "用户详情(含角色信息)"
@handler GetUserDetail
get /user/detail (IdQueryReq) returns (UserDetailResp)
@doc "创建用户"
@handler CreateUser
post /user/create (UserCreateReq)
@@ -281,5 +317,9 @@ service system-api {
@doc "重置密码"
@handler ResetPassword
post /user/resetPassword (ResetPasswordReq)
@doc "用户授权角色"
@handler AssignUserRoles
post /user/assignRoles (AssignUserRolesReq)
}