MarketingSystemDataExportTool/grpc/user/userv1/menu.proto

166 lines
3.3 KiB
Protocol Buffer

syntax = "proto3";
package user.userv1;
import "validate/validate.proto";
import "user/userv1/common.proto";
option go_package = "./user/userv1;userv1";
// 菜单服务
service Menu {
// 获取菜单列表
rpc GetList (ReqMenuGetList) returns (RespMenus) {}
// 获取菜单
rpc GetInfo (ReqMenuGetMenu) returns (RespMenu) {}
// 保存菜单
rpc Save (ReqMenuSave) returns (RespMenu) {}
// 删除菜单
rpc Delete (ReqMenuDelete) returns (RespEmpty) {}
// 获取有用户权限的菜单信息
rpc GetMyMenus(ReqMenuGetMyMenus) returns(RespMenuGetMyMenus) {}
// 设置网关的 apis
rpc SetGatewayApis(ReqEmpty) returns(RespEmpty) {}
}
//菜单列表请求
message ReqMenuGetList {
// 系统 id
int32 systemId = 1;
}
//菜单列表
message RespMenus {
repeated RespMenu list = 1;
}
//菜单请求
message ReqMenuGetMenu {
// 菜单 id
int32 id = 1 [(validate.rules).int32.gt = 0];
}
//菜单项
message RespMenu {
// 菜单 id
int32 id = 1;
// 菜单父级 id
int32 pid = 2;
// 系统 id
int32 systemId = 3;
// 菜单类型
int32 type = 4;
// 菜单名称
string title = 5;
// 前端路径
string url = 6;
// 菜单图标
string icon = 7;
// 菜单排序
int32 sort = 8;
// 菜单状态
int32 status = 9;
// 菜单组件
string component = 10;
// 创建时间
int32 createTime = 11;
// 更新时间
int32 updateTime = 12;
// 菜单 api 路径
string apiPath = 13;
// 菜单 api 请求方法
int32 apiMethod = 14;
// 菜单 api 请求方法
string apiMethodName = 15;
// 菜单 api 请求code
string apiMethodCode = 16;
// 菜单 处理类型
int32 processType = 17;
// 权限描述
string desc = 18;
// 解析过的处理类型
MenuProcessTypePart processTypePart = 19;
// pTitle
string pTitle = 20;
}
// 解析过的处理类型
message MenuProcessTypePart {
// 是否显示
bool isShow = 1;
// 是否授权
bool isAuth = 2;
// 是否记录日志
bool isLog = 3;
// 是否登录
bool isLogin = 4;
// 是否包含数据权限校验
bool isDataPrivilege = 5;
}
//菜单保存请求
message ReqMenuSave {
// 菜单 id
int32 id = 1;
// 菜单父级 id
int32 pid = 2;
// 系统 id
int32 systemId = 3 [(validate.rules).int32.gt = 0];
// 菜单类型
int32 type = 4 [(validate.rules).int32.gt = 0];
// 菜单名称
string title = 5 [(validate.rules).string.min_len = 1];
// 前端路径
string url = 6;
// 菜单图标
string icon = 7;
// 菜单排序
int32 sort = 8;
// 菜单组件
string component = 10;
// 菜单 api 路径
string apiPath = 11;
// 菜单 api 请求方法
int32 apiMethod = 12;
// 权限描述
string desc = 13;
// 菜单 处理类型
MenuProcessTypePart processTypePart = 16;
}
//菜单删除请求
message ReqMenuDelete {
// 菜单 id
repeated int32 ids = 1 [(validate.rules).repeated.min_items = 1];
}
// 获取有用户权限的菜单信息
message ReqMenuGetMyMenus {
// 系统 id
int32 systemId = 1;
// 用户 id
int32 userId = 2 [(validate.rules).int32.gt = 0];
// 显示类型
ShowType showType = 3;
// 系统 code
string systemCode = 4;
// 菜单类型
enum ShowType {
SHOW = 0;
ALL = 1;
HIDE = 2;
}
}
// 响应有用户权限的菜单信息
message RespMenuGetMyMenus {
// 菜单列表
repeated RespMenu list = 1;
}