system.proto 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. syntax = "proto3";
  2. // package声明符,用来防止不同的消息类型有命名冲突
  3. package pb_v1;
  4. // 用于生成指定语言go的包名称
  5. option go_package = "cp-system-management/pb/v1";
  6. message CreateUserRequest{
  7. string username = 1;
  8. string password = 2;
  9. }
  10. message CreateUserReply {
  11. int64 uid = 1;
  12. }
  13. message LoginRequest{
  14. string username = 1;
  15. string password = 2;
  16. }
  17. message LoginReply {
  18. int64 uid = 1;
  19. }
  20. message ChangePasswordRequest{
  21. int64 uid = 1;
  22. string password = 2;
  23. string old = 3;
  24. }
  25. message ChangePasswordReply {
  26. }
  27. message CreateOrganizationRequest{
  28. string organization_name = 1;
  29. int64 month = 2;
  30. bool is_disable = 3;
  31. }
  32. message CreateOrganizationReply {
  33. string organization_code = 1;
  34. }
  35. message DeleteOrganizationRequest{
  36. string organization_code = 1;
  37. }
  38. message DeleteOrganizationReply {
  39. }
  40. message Organization {
  41. string organization_name = 1;
  42. string organization_code = 2;
  43. int64 end_time = 3;
  44. bool is_disable = 4;
  45. bool is_expire = 5;
  46. string key = 6;
  47. }
  48. message UpdateOrganizationRequest{
  49. string organization_name = 1;
  50. int64 month = 2;
  51. bool is_disable = 3;
  52. string organization_code = 4;
  53. }
  54. message UpdateOrganizationReply {
  55. UpdateOrganizationRequest origin = 1;
  56. }
  57. message OrganizationListRequest{
  58. int64 page = 1;
  59. int64 page_size = 2;
  60. string filter = 3;
  61. }
  62. message OrganizationListReply {
  63. int64 total = 1;
  64. int64 page=2;
  65. repeated Organization list = 3;
  66. }
  67. message CreateOrganizationUserRequest{
  68. string organization_code = 1;
  69. string username = 2;
  70. string password = 3;
  71. string phone = 4;
  72. string email = 5;
  73. }
  74. message CreateOrganizationUserReply {
  75. int64 uid = 1;
  76. }
  77. message OrganizationUserListRequest {
  78. int64 page = 1;
  79. int64 page_size = 2;
  80. string organization_code = 3;
  81. }
  82. message OrganizationUserItem {
  83. string organization_code = 1;
  84. string username = 2;
  85. string phone = 3;
  86. string email = 4;
  87. int64 id = 5;
  88. string created_at = 6;
  89. }
  90. message OrganizationUserListReply {
  91. int64 total = 1;
  92. int64 page = 2;
  93. repeated OrganizationUserItem list = 3;
  94. }
  95. message OrganizationUserUpdateRequest {
  96. string organization_code = 1;
  97. string username = 2;
  98. string phone = 3;
  99. string email = 4;
  100. int64 id = 5;
  101. string password = 6;
  102. }
  103. message OrganizationUserUpdateReply {
  104. OrganizationUserUpdateRequest origin = 1;
  105. }
  106. message OrganizationUserResetPasswordRequest {
  107. string organization_code = 1;
  108. int64 id = 2;
  109. string password = 3;
  110. }
  111. message OrganizationUserResetPasswordReply {
  112. }
  113. message SystemLogAddRequest {
  114. string username = 1;
  115. int64 uid = 2;
  116. string action = 3;
  117. string module = 4;
  118. int64 created_at = 6;
  119. string origin = 7;
  120. string target = 8;
  121. }
  122. message SystemLogAddReply {
  123. }
  124. message SystemLogListRequest {
  125. int64 page = 1;
  126. int64 page_size = 2;
  127. string username = 3;
  128. string action = 4;
  129. string filter = 5;
  130. string module = 6;
  131. int64 start = 7;
  132. int64 end = 8;
  133. }
  134. message SystemLogItem {
  135. // 账号名
  136. string username = 1;
  137. // 账号id
  138. int64 uid = 2;
  139. // 行为
  140. string action = 3;
  141. // 模块
  142. string module = 4;
  143. // 时间
  144. string created_at = 6;
  145. // 修改前信息
  146. string origin = 7;
  147. // 修改后信息
  148. string target = 8;
  149. // 日志id
  150. int64 id = 9;
  151. }
  152. message SystemLogListReply {
  153. int64 total = 1;
  154. int64 page = 2;
  155. repeated SystemLogItem list = 3;
  156. }
  157. message OrganizationKeyAuthRequest {
  158. string key = 1;
  159. }
  160. message OrganizationKeyAuthReply {
  161. string organization_code = 1;
  162. string organization_name = 2;
  163. int64 end_time = 3;
  164. bool is_disable = 4;
  165. }