123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220 |
- syntax = "proto3";
- package backend.operation;
- option go_package = ".;operationPb";
- import "backend/operation/enum.proto";
- import "backend/operation/pagination.proto";
- import "backend/operation/pasture.proto";
- message CommonOK {
- int32 code = 1;
- string msg = 2;
- Success data = 3;
- }
- message Success {
- bool success = 1;
- }
- message WxOpenId {
- string openid = 1;
- }
- // 用户角色
- message AddRoleRequest {
- uint32 id = 1;
- string name = 2; // 角色名称
- string remarks = 3; // 角色备注
- IsShow.Kind is_show = 4; // 是否启用
- repeated uint32 pasture_id = 5; // 牧场id
- repeated uint32 menu_id = 6; // 菜单id
- repeated uint32 mobile_id = 7; // 移动端id
- string create_user = 8; // 创建用户
- uint32 created_at = 9; // 创建时间
- string created_at_format = 10; // 创建时间格式化
- repeated string pasture_list = 11; // 负责的牧场
- repeated string menu_list = 12; // 权限列表
- }
- message SearchRoleRequest {
- string name = 3; // 角色名称
- PaginationModel pagination = 2; // 分页
- }
- message SearchRoleResponse {
- uint32 code = 1;
- string msg = 2;
- SearchRoleData data = 3;
- }
- message SearchRoleData {
- int32 page = 1;
- int32 total = 2;
- int32 page_size = 3;
- repeated AddRoleRequest list = 4;
- }
- // 角色对应权限列表
- message RolePermissionsList {
- int32 code = 1;
- string msg = 2;
- RolePermissionsData data = 3;
- }
- message RolePermissionsData {
- repeated uint32 mobile_list = 1; // 移动端权限id
- repeated uint32 pasture_list = 2; // 牧场端列表
- repeated uint32 menu_list = 3; // 后端权限列表
- }
- // 用户token
- message SystemToken {
- int32 code = 1;
- string msg = 2;
- TokenData data = 3;
- }
- message TokenData {
- string token = 1;
- }
- // 用户登录
- message UserAuth {
- int32 code = 1;
- string msg = 2;
- UserAuthData data = 3;
- }
- message UserAuthData {
- string user_name = 1; // 用户名称
- string password = 2; // 用户密码
- string phone = 3; // 用户手机号
- repeated UserRole roles = 4; // 用户角色
- string employee_name = 5; // 员工名称
- repeated UserPasture pastures = 6; // 用户角色牧场牧场
- }
- message UserRole {
- int32 id = 1; // 角色id
- string name = 2; // 角色名称
- }
- // 用户详情
- message UserDetails {
- int32 code = 1;
- string msg = 2;
- AddSystemUser data = 3;
- }
- message AddSystemUser {
- int32 id = 1; // 用户id
- string name = 2; // 用户名称
- string phone = 3; // 用户手机号
- repeated UserRole roles = 4; // 角色
- IsShow.Kind is_show = 5; // 是否开启
- string employee_name = 6; // 员工姓名
- string create_user = 7; // 创建人
- int32 created_at = 8; // 创建时间
- string created_at_format = 9; // 创建时间格式化
- string role_name = 10; // 角色名称
- repeated int32 role_ids = 11; // 角色ids
- }
- // 查询用户
- message SearchUserRequest {
- string name = 1; // 用户名称
- string employee_name = 2; // 员工姓名
- IsShow.Kind is_show = 3; // 是否启用
- uint32 created_start_time = 4; // 开始时间
- uint32 created_end_time = 5; // 结束时间
- PaginationModel pagination = 6; // 分页
- }
- message SearchUserResponse {
- int32 code = 1;
- string msg = 2;
- SearchUserData data = 3;
- }
- message SearchUserData {
- int32 page = 1;
- int32 total = 2;
- int32 page_size = 3;
- repeated AddSystemUser list = 4;
- }
- message IsShowSystemUserRequest {
- int32 user_id = 1; // 用户id
- IsShow.Kind is_show = 2; // is_show
- }
- // 系统菜单权限
- message AddMenuRequest {
- int32 id = 1;
- string name = 2; // 名称
- int32 parent_id = 3; // 父id
- int32 menu_type = 4; // 菜单类型 1 菜单 2 按钮
- string title = 5; // 标题
- string path = 6; // 路径 path
- IsShow.Kind is_show = 7; // 是否显示
- string component = 8; // 组件
- string icon = 9; // 图标
- int32 sort = 10; // 排序
- string redirect = 11; // 重定向
- int32 created_at = 12; // 创建时间
- string created_at_format = 13; // 创建时间格式化
- int32 level = 14; // 菜单等级
- repeated AddMenuRequest children = 15; // 子分类
- bool affix = 16;
- bool keepAlive = 17;
- }
- message IsShowSystemMenuRequest {
- int32 menu_id = 1; // 角色id
- IsShow.Kind is_show = 2; // is_show
- }
- // 查询菜单权限
- message SearchMenuRequest {
- string name = 1; // 菜单名称
- PaginationModel pagination = 2; // 分页
- }
- message SearchMenuResponse {
- int32 code = 1;
- string msg = 2;
- SearchMenuData data = 3;
- }
- message SearchMenuData {
- int32 page = 1;
- int32 total = 2;
- repeated AddMenuRequest list = 3;
- }
- // 系统用户权限相关
- message SystemUserMenuPermissions {
- int32 code = 1;
- string msg = 2;
- SystemUserMenuData data = 3;
- }
- message SystemUserMenuData {
- repeated AddPastureRequest pasture_list = 1; // 牧场列表
- repeated AddMenuRequest menu_list = 2; // 菜单列表
- repeated AddMobileRequest mobile_list = 3; // 移动端权限
- repeated MenuButtonsPath menu_buttons_path = 4; // 按钮级别权限path,前端需要特别处理
- }
- message MenuButtonsPath {
- string path = 1;
- int32 menu_id = 2;
- }
- // 移动端
- message AddMobileRequest {
- uint32 id = 1; // id
- string name = 2; // 名称
- }
|