system.proto 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. syntax = "proto3";
  2. package backend.operation;
  3. option go_package = ".;operationPb";
  4. import "backend/operation/enum.proto";
  5. import "backend/operation/pagination.proto";
  6. import "backend/operation/pasture.proto";
  7. message CommonOK {
  8. int32 code = 1;
  9. string msg = 2;
  10. Success data = 3;
  11. }
  12. message Success {
  13. bool success = 1;
  14. }
  15. message WxOpenId {
  16. string openid = 1;
  17. }
  18. // 用户角色
  19. message AddRoleRequest {
  20. uint32 id = 1;
  21. string name = 2; // 角色名称
  22. string remarks = 3; // 角色备注
  23. IsShow.Kind is_show = 4; // 是否启用
  24. repeated uint32 pasture_id = 5; // 牧场id
  25. repeated uint32 menu_id = 6; // 菜单id
  26. repeated uint32 mobile_id = 7; // 移动端id
  27. string create_user = 8; // 创建用户
  28. uint32 created_at = 9; // 创建时间
  29. string created_at_format = 10; // 创建时间格式化
  30. repeated string pasture_list = 11; // 负责的牧场
  31. repeated string menu_list = 12; // 权限列表
  32. }
  33. message SearchRoleRequest {
  34. string name = 3; // 角色名称
  35. PaginationModel pagination = 2; // 分页
  36. }
  37. message SearchRoleResponse {
  38. uint32 code = 1;
  39. string msg = 2;
  40. SearchRoleData data = 3;
  41. }
  42. message SearchRoleData {
  43. int32 page = 1;
  44. int32 total = 2;
  45. int32 page_size = 3;
  46. repeated AddRoleRequest list = 4;
  47. }
  48. // 角色对应权限列表
  49. message RolePermissionsList {
  50. int32 code = 1;
  51. string msg = 2;
  52. RolePermissionsData data = 3;
  53. }
  54. message RolePermissionsData {
  55. repeated uint32 mobile_list = 1; // 移动端权限id
  56. repeated uint32 pasture_list = 2; // 牧场端列表
  57. repeated uint32 menu_list = 3; // 后端权限列表
  58. }
  59. // 用户token
  60. message SystemToken {
  61. int32 code = 1;
  62. string msg = 2;
  63. TokenData data = 3;
  64. }
  65. message TokenData {
  66. string token = 1;
  67. }
  68. // 用户登录
  69. message UserAuth {
  70. int32 code = 1;
  71. string msg = 2;
  72. UserAuthData data = 3;
  73. }
  74. message UserAuthData {
  75. string user_name = 1; // 用户名称
  76. string password = 2; // 用户密码
  77. string phone = 3; // 用户手机号
  78. repeated UserRole roles = 4; // 用户角色
  79. string employee_name = 5; // 员工名称
  80. repeated UserPasture pastures = 6; // 用户角色牧场牧场
  81. }
  82. message UserRole {
  83. int32 id = 1; // 角色id
  84. string name = 2; // 角色名称
  85. }
  86. // 用户详情
  87. message UserDetails {
  88. int32 code = 1;
  89. string msg = 2;
  90. AddSystemUser data = 3;
  91. }
  92. message AddSystemUser {
  93. int32 id = 1; // 用户id
  94. string name = 2; // 用户名称
  95. string phone = 3; // 用户手机号
  96. repeated UserRole roles = 4; // 角色
  97. IsShow.Kind is_show = 5; // 是否开启
  98. string employee_name = 6; // 员工姓名
  99. string create_user = 7; // 创建人
  100. int32 created_at = 8; // 创建时间
  101. string created_at_format = 9; // 创建时间格式化
  102. string role_name = 10; // 角色名称
  103. repeated int32 role_ids = 11; // 角色ids
  104. }
  105. // 查询用户
  106. message SearchUserRequest {
  107. string name = 1; // 用户名称
  108. string employee_name = 2; // 员工姓名
  109. IsShow.Kind is_show = 3; // 是否启用
  110. uint32 created_start_time = 4; // 开始时间
  111. uint32 created_end_time = 5; // 结束时间
  112. PaginationModel pagination = 6; // 分页
  113. }
  114. message SearchUserResponse {
  115. int32 code = 1;
  116. string msg = 2;
  117. SearchUserData data = 3;
  118. }
  119. message SearchUserData {
  120. int32 page = 1;
  121. int32 total = 2;
  122. int32 page_size = 3;
  123. repeated AddSystemUser list = 4;
  124. }
  125. message IsShowSystemUserRequest {
  126. int32 user_id = 1; // 用户id
  127. IsShow.Kind is_show = 2; // is_show
  128. }
  129. // 系统菜单权限
  130. message AddMenuRequest {
  131. int32 id = 1;
  132. string name = 2; // 名称
  133. int32 parent_id = 3; // 父id
  134. int32 menu_type = 4; // 菜单类型 1 菜单 2 按钮
  135. string title = 5; // 标题
  136. string path = 6; // 路径 path
  137. IsShow.Kind is_show = 7; // 是否显示
  138. string component = 8; // 组件
  139. string icon = 9; // 图标
  140. int32 sort = 10; // 排序
  141. string redirect = 11; // 重定向
  142. int32 created_at = 12; // 创建时间
  143. string created_at_format = 13; // 创建时间格式化
  144. int32 level = 14; // 菜单等级
  145. repeated AddMenuRequest children = 15; // 子分类
  146. bool affix = 16;
  147. bool keepAlive = 17;
  148. }
  149. message IsShowSystemMenuRequest {
  150. int32 menu_id = 1; // 角色id
  151. IsShow.Kind is_show = 2; // is_show
  152. }
  153. // 查询菜单权限
  154. message SearchMenuRequest {
  155. string name = 1; // 菜单名称
  156. PaginationModel pagination = 2; // 分页
  157. }
  158. message SearchMenuResponse {
  159. int32 code = 1;
  160. string msg = 2;
  161. SearchMenuData data = 3;
  162. }
  163. message SearchMenuData {
  164. int32 page = 1;
  165. int32 total = 2;
  166. repeated AddMenuRequest list = 3;
  167. }
  168. // 系统用户权限相关
  169. message SystemUserMenuPermissions {
  170. int32 code = 1;
  171. string msg = 2;
  172. SystemUserMenuData data = 3;
  173. }
  174. message SystemUserMenuData {
  175. repeated AddPastureRequest pasture_list = 1; // 牧场列表
  176. repeated AddMenuRequest menu_list = 2; // 菜单列表
  177. repeated AddMobileRequest mobile_list = 3; // 移动端权限
  178. repeated MenuButtonsPath menu_buttons_path = 4; // 按钮级别权限path,前端需要特别处理
  179. }
  180. message MenuButtonsPath {
  181. string path = 1;
  182. int32 menu_id = 2;
  183. }
  184. // 移动端
  185. message AddMobileRequest {
  186. uint32 id = 1; // id
  187. string name = 2; // 名称
  188. }