87 lines
1.5 KiB
Protocol Buffer
87 lines
1.5 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package system;
|
|
|
|
option go_package = "./system";
|
|
|
|
// ---------- 通用消息 ----------
|
|
|
|
message CommonResp {
|
|
int64 code = 1;
|
|
string msg = 2;
|
|
}
|
|
|
|
// ---------- 角色信息 ----------
|
|
|
|
message RoleInfo {
|
|
string id = 1;
|
|
string name = 2;
|
|
string code = 3;
|
|
int32 sort = 4;
|
|
}
|
|
|
|
// ---------- 菜单信息 ----------
|
|
|
|
message MenuInfo {
|
|
string id = 1;
|
|
string parentId = 2;
|
|
int32 category = 3;
|
|
string name = 4;
|
|
string title = 5;
|
|
string code = 6;
|
|
string path = 7;
|
|
string permission = 8;
|
|
string locale = 9;
|
|
string icon = 10;
|
|
int32 sort = 11;
|
|
repeated MenuInfo children = 12;
|
|
}
|
|
|
|
// ---------- 客户端信息 ----------
|
|
|
|
message ClientInfo {
|
|
string id = 1;
|
|
string clientId = 2;
|
|
string name = 3;
|
|
string grantType = 4;
|
|
string additionalInfo = 5;
|
|
int64 activeTimeout = 6;
|
|
}
|
|
|
|
// ---------- 请求/响应 ----------
|
|
|
|
message GetRolesByUserIdReq {
|
|
string userId = 1;
|
|
}
|
|
|
|
message GetRolesByUserIdResp {
|
|
repeated RoleInfo roles = 1;
|
|
}
|
|
|
|
message GetMenusByRoleIdReq {
|
|
string roleId = 1;
|
|
}
|
|
|
|
message GetMenusByRoleIdResp {
|
|
repeated MenuInfo menus = 1;
|
|
}
|
|
|
|
message GetClientByIdReq {
|
|
string clientId = 1;
|
|
}
|
|
|
|
message GetClientByIdResp {
|
|
ClientInfo client = 1;
|
|
}
|
|
|
|
// ---------- 服务定义 ----------
|
|
|
|
service SystemService {
|
|
// 获取用户角色列表
|
|
rpc GetRolesByUserId(GetRolesByUserIdReq) returns (GetRolesByUserIdResp);
|
|
// 获取角色菜单列表
|
|
rpc GetMenusByRoleId(GetMenusByRoleIdReq) returns (GetMenusByRoleIdResp);
|
|
// 获取客户端信息
|
|
rpc GetClientById(GetClientByIdReq) returns (GetClientByIdResp);
|
|
}
|