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
+44 -1
View File
@@ -27,6 +27,7 @@ message RoleInfo {
string code = 3;
int32 sort = 4;
repeated string menuIds = 5;
int64 createdAt = 6;
}
message RoleReq {
@@ -41,7 +42,17 @@ message RoleUpdateReq {
string name = 2;
string code = 3;
int32 sort = 4;
repeated string menuIds = 5;
}
// RBAC 授权
message AssignRoleMenusReq {
string roleId = 1;
repeated string menuIds = 2;
}
message AssignUserRolesReq {
string userId = 1;
repeated string roleIds = 2;
}
message RoleListReq {
@@ -55,6 +66,18 @@ message RoleListResp {
int64 total = 2;
}
message GetRoleDetailReq {
string id = 1;
}
message RoleDetailResp {
string id = 1;
string name = 2;
string code = 3;
int32 sort = 4;
repeated string menuIds = 5;
}
// ========== 菜单 ==========
message MenuInfo {
@@ -253,6 +276,7 @@ message UserInfo {
int64 createdAt = 22;
int64 updatedAt = 23;
string avatarUrl = 24;
repeated RoleInfo roles = 25;
}
message GetUserByIdReq {
@@ -315,6 +339,19 @@ message GetUserListResp {
int64 total = 2;
}
message GetUserDetailReq {
string id = 1;
}
message UserDetailResp {
string id = 1;
string name = 2;
string account = 3;
string nickName = 4;
string phone = 5;
repeated string roleIds = 6;
}
message DeleteUserReq {
repeated string ids = 1;
}
@@ -360,6 +397,7 @@ service SystemService {
rpc CreateUser(CreateUserReq) returns (CreateUserResp);
rpc UpdateUser(UpdateUserReq) returns (CommonResp);
rpc GetUserList(GetUserListReq) returns (GetUserListResp);
rpc GetUserDetail(GetUserDetailReq) returns (UserDetailResp);
rpc DeleteUser(DeleteUserReq) returns (CommonResp);
rpc ResetPassword(ResetPasswordReq) returns (CommonResp);
@@ -369,6 +407,11 @@ service SystemService {
rpc UpdateRole(RoleUpdateReq) returns (CommonResp);
rpc DeleteRole(IdsReq) returns (CommonResp);
rpc GetRoleList(RoleListReq) returns (RoleListResp);
rpc GetRoleDetail(GetRoleDetailReq) returns (RoleDetailResp);
rpc AssignRoleMenus(AssignRoleMenusReq) returns (CommonResp);
// --- RBAC 用户授权 ---
rpc AssignUserRoles(AssignUserRolesReq) returns (CommonResp);
// --- 菜单 ---
rpc GetMenusByRoleId(GetMenusByRoleIdReq) returns (GetMenusByRoleIdResp);