organization.proto 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. syntax = "proto3";
  2. // package声明符,用来防止不同的消息类型有命名冲突
  3. package pb_v1;
  4. // 用于生成指定语言go的包名称
  5. option go_package = "cp-organization-management/pb/v1";
  6. message InitOrganizationDbRequest{
  7. string organization_code = 1;
  8. }
  9. message InitOrganizationDbReply{
  10. }
  11. message RbacNode {
  12. int64 id = 1;
  13. string name =2;
  14. string router=3;
  15. string method=4;
  16. string resource=5;
  17. string object=6;
  18. int64 pid=7;
  19. bool is_super = 8;
  20. }
  21. message CreateManagementUserRequest{
  22. string organization_code = 1;
  23. string username = 2;
  24. string password = 3;
  25. string phone = 4;
  26. string email = 5;
  27. repeated RbacNode rbac_node_list=6;
  28. bool is_supper_user = 7;
  29. int64 group_id = 8;
  30. string zones = 9;
  31. string name = 10;
  32. int64 uid = 11;
  33. }
  34. message CreateManagementUserReply{
  35. int64 uid = 1;
  36. }
  37. message ManagementSuperUserItem {
  38. string organization_code = 1;
  39. string username = 2;
  40. string phone = 3;
  41. string email = 4;
  42. int64 id = 5;
  43. string created_at = 6;
  44. }
  45. // 供系统端调用
  46. message ManagementSuperUserListRequest {
  47. int64 page = 1;
  48. int64 page_size = 2;
  49. string organization_code = 3;
  50. }
  51. message ManagementSuperUserListReply {
  52. int64 total = 1;
  53. int64 page = 2;
  54. repeated ManagementSuperUserItem list = 3;
  55. }
  56. message ManagementSuperUserUpdateRequest {
  57. string organization_code = 1;
  58. string username = 2;
  59. string phone = 3;
  60. string email = 4;
  61. int64 id = 5;
  62. string password = 6;
  63. }
  64. message ManagementSuperUserUpdateReply {
  65. ManagementSuperUserUpdateRequest origin = 1;
  66. }
  67. message ManagementSuperUserResetPasswordRequest {
  68. string organization_code = 1;
  69. int64 id = 2;
  70. string password = 3;
  71. }
  72. message ManagementSuperUserResetPasswordReply {
  73. }
  74. message ManagementLoginRequest {
  75. string key = 1;
  76. string username = 2;
  77. string password = 3;
  78. }
  79. message ManagementLoginReply {
  80. int64 uid = 1;
  81. string organization_code = 2;
  82. int64 end_time = 3;
  83. string organization_name = 4;
  84. repeated string permissions = 5;
  85. bool is_super = 6;
  86. }
  87. //-----------------------------------角色相关----------------------------
  88. // 所有节点列表
  89. message RbacNodeListRequest {
  90. string organization_code = 1;
  91. bool is_all = 2;
  92. }
  93. message RbacNodeItem {
  94. int64 id = 1;
  95. int64 pid = 2;
  96. string name = 3;
  97. string method = 4;
  98. string resource = 5;
  99. string object = 6;
  100. string router = 7;
  101. bool select = 8;
  102. repeated RbacNodeItem childs = 9;
  103. }
  104. message RbacNodeListReply {
  105. repeated RbacNodeItem list = 1;
  106. }
  107. // 所有角色列表
  108. message RbacGroupItem {
  109. string name = 1;
  110. int64 id = 2;
  111. }
  112. message RbacGroupListRequest {
  113. string organization_code = 1;
  114. bool is_super = 2;
  115. }
  116. message RbacGroupListReply {
  117. repeated RbacGroupItem list = 1;
  118. }
  119. // 添加角色
  120. message RbacGroupAddRequest {
  121. string name = 1;
  122. string node_list = 2;
  123. string organization_code = 3;
  124. int64 uid = 4;
  125. }
  126. message RbacGroupAddReply {
  127. int64 id = 1;
  128. }
  129. // 更新角色 是否super
  130. message RbacGroupUpdateRequest {
  131. string organization_code = 1;
  132. int64 id = 2;
  133. string name = 3;
  134. string node_list = 4;
  135. int64 uid = 5;
  136. }
  137. message RbacGroupUpdateReply {
  138. RbacGroupUpdateRequest origin = 1;
  139. }
  140. // 删除角色 1.判断是否已绑定角色 2 是否super
  141. message RbacGroupDelRequest {
  142. string organization_code = 1;
  143. int64 id = 2;
  144. int64 uid = 3;
  145. }
  146. message RbacGroupDelReply {
  147. RbacGroupUpdateRequest origin = 1;
  148. }
  149. // 根据角色或用户获取节点
  150. message RbacNodeListByGroupOrUserRequest {
  151. string organization_code = 1;
  152. int64 group_id = 2;
  153. int64 uid = 3;
  154. // 仅返回选中的数据
  155. bool select = 4;
  156. }
  157. message RbacNodeListByGroupOrUserReply {
  158. repeated RbacNodeItem list = 1;
  159. }
  160. //----------------------------区域相关-------------------------------
  161. message ZoneAddRequest {
  162. string zone_name = 1;
  163. string parent_zone_code = 2;
  164. string organization_code = 3;
  165. int64 uid = 4;
  166. }
  167. message ZoneAddReply {
  168. string zone_code = 1;
  169. }
  170. message ZoneDelRequest {
  171. string zone_code = 1;
  172. string organization_code = 2;
  173. int64 uid = 4;
  174. }
  175. message ZoneData {
  176. string zone_code = 1;
  177. string zone_name = 2;
  178. }
  179. message ZoneDelReply {
  180. repeated ZoneData zones = 1;
  181. }
  182. message ZoneUpdateRequest {
  183. string zone_code = 1;
  184. string organization_code = 2;
  185. string zone_name = 3;
  186. int64 uid = 4;
  187. string parent_zone_code = 5;
  188. }
  189. message ZoneUpdateReply {
  190. ZoneUpdateRequest origin = 1;
  191. ZoneUpdateRequest target = 2;
  192. }
  193. message ZoneItem {
  194. string zone_code = 1;
  195. string parent_zone_code = 2;
  196. string zone_name = 3;
  197. repeated ZoneItem childs = 4;
  198. }
  199. message ZoneItemSelect {
  200. string zone_code = 1;
  201. string parent_zone_code = 2;
  202. string zone_name = 3;
  203. bool select = 4;
  204. repeated ZoneItemSelect childs = 5;
  205. }
  206. message ZoneListRequest {
  207. int64 uid = 1;
  208. string organization_code = 2;
  209. }
  210. message ZoneListReply {
  211. repeated ZoneItem list = 1;
  212. }
  213. //--------------------------用户管理相关-------------------
  214. message UserListRequest {
  215. string organization = 1;
  216. string filter = 2;
  217. int64 uid = 3;
  218. int64 page = 4;
  219. int64 page_size = 5;
  220. string zone = 6;
  221. }
  222. message UserItem {
  223. int64 id = 1;
  224. string name = 2;
  225. string username = 3;
  226. string phone = 4;
  227. string email = 5;
  228. repeated string zones = 6;
  229. }
  230. message UserListReply {
  231. int64 total = 1;
  232. int64 page = 2;
  233. repeated UserItem list = 3;
  234. }
  235. message UserInfoRequest {
  236. int64 id = 1;
  237. int64 uid = 2;
  238. string organization_code = 3;
  239. }
  240. // 权限列表返回uid 所拥有的区域, 对id所拥有的区域进行打勾
  241. // 编辑时不能将非uid区域的数据从id的区域中删除
  242. message UserInfoReply {
  243. int64 id = 1;
  244. string name = 2;
  245. string username = 3;
  246. string phone = 4;
  247. string email = 5;
  248. // 所属角色
  249. int64 group_id = 6;
  250. string group_name = 7;
  251. // 所拥有的权限
  252. repeated RbacNodeItem node_list = 8;
  253. repeated ZoneItemSelect zone_list = 9;
  254. }
  255. message UserDelRequest {
  256. int64 id = 1;
  257. int64 uid = 2;
  258. string organization_code = 3;
  259. }
  260. message UserDelReply {
  261. int64 id = 1;
  262. string name = 2;
  263. string username = 3;
  264. string phone = 4;
  265. string email = 5;
  266. }
  267. message UserUpdateRequest {
  268. int64 id = 1;
  269. int64 uid = 2;
  270. string organization_code = 3;
  271. string username = 4;
  272. string password = 5;
  273. string phone = 6;
  274. string email = 7;
  275. int64 group_id = 8;
  276. string zones = 9;
  277. string name = 10;
  278. }
  279. message UserUpdateReply {
  280. UserUpdateRequest origin = 1;
  281. }
  282. message ManagementLogAddRequest {
  283. string username = 1;
  284. int64 uid = 2;
  285. string action = 3;
  286. string module = 4;
  287. int64 created_at = 6;
  288. string origin = 7;
  289. string target = 8;
  290. string organization_code = 9;
  291. }
  292. message ManagementLogAddReply {
  293. }
  294. message ManagementLogListRequest {
  295. int64 page = 1;
  296. int64 page_size = 2;
  297. string username = 3;
  298. string action = 4;
  299. string filter = 5;
  300. string module = 6;
  301. int64 start = 7;
  302. int64 end = 8;
  303. string organization_code = 9;
  304. }
  305. message ManagementLogItem {
  306. // 账号名
  307. string username = 1;
  308. // 账号id
  309. int64 uid = 2;
  310. // 行为
  311. string action = 3;
  312. // 模块
  313. string module = 4;
  314. // 时间
  315. string created_at = 6;
  316. // 修改前信息
  317. string origin = 7;
  318. // 修改后信息
  319. string target = 8;
  320. // 日志id
  321. int64 id = 9;
  322. }
  323. message ManagementLogListReply {
  324. int64 total = 1;
  325. int64 page = 2;
  326. repeated ManagementLogItem list = 3;
  327. }