neighbor.proto 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. syntax = "proto3";
  2. // package声明符,用来防止不同的消息类型有命名冲突
  3. package pb_v1;
  4. // 用于生成指定语言go的包名称
  5. option go_package = "property-garden/pb/v1";
  6. // 社区邻里分类
  7. message NeighborClassAddRequest {
  8. int64 garden_id = 1;
  9. // 分类名
  10. string class_name = 2;
  11. // 分类图标
  12. string class_pic = 3;
  13. // true 开启 false 禁用
  14. bool enable = 4;
  15. }
  16. message NeighborClassAddReply {
  17. }
  18. message NeighborClassDelRequest {
  19. int64 garden_id = 1;
  20. int64 id = 2;
  21. }
  22. message NeighborClassDelReply {
  23. }
  24. message NeighborClassUpdateRequest {
  25. int64 garden_id = 1;
  26. int64 id = 2;
  27. string class_name = 3;
  28. string class_pic = 4;
  29. bool enable = 5;
  30. }
  31. message NeighborClassUpdateReply {
  32. }
  33. message NeighborClassItem {
  34. int64 id = 1;
  35. string class_name = 2;
  36. string class_pic = 3;
  37. bool enable = 4;
  38. // 分类下的文章总数
  39. int64 article_count = 5;
  40. // 分类创建时间
  41. string created_at = 6;
  42. // 分类结束时间
  43. string updated_at = 7;
  44. }
  45. message NeighborClassListRequest {
  46. int64 garden_id = 1;
  47. string class_name = 2;
  48. int64 page = 3;
  49. int64 page_size = 4;
  50. }
  51. message NeighborClassListReply {
  52. int64 page = 1;
  53. int64 total = 2;
  54. repeated NeighborClassItem list = 3;
  55. }
  56. // 社区邻里文章
  57. message NeighborArticleAddRequest {
  58. int64 garden_id = 1;
  59. // 文章标题
  60. string title = 2;
  61. // 文章类容
  62. string content = 3;
  63. // 文章图片
  64. repeated string pics = 4;
  65. // 分类id
  66. int64 class_id = 5;
  67. int64 uid = 6;
  68. string user_icon = 7;
  69. string nick_name = 8;
  70. }
  71. message NeighborArticleAddReply {
  72. }
  73. message NeighborArticleDelRequest {
  74. int64 garden_id = 1;
  75. int64 id = 2;
  76. int64 uid = 3;
  77. bool admin = 4;
  78. }
  79. message NeighborArticleDelReply {
  80. }
  81. message NeighborArticleUpdateRequest {
  82. int64 garden_id = 1;
  83. string title = 2;
  84. string content = 3;
  85. repeated string pics = 4;
  86. int64 id = 5;
  87. int64 uid = 6;
  88. }
  89. message NeighborArticleUpdateReply {
  90. }
  91. message NeighborArticleItem {
  92. int64 id = 1;
  93. string title = 2;
  94. string content = 3;
  95. repeated string pics = 4;
  96. // 文章点赞数
  97. int64 likes = 5;
  98. // 评论总数
  99. int64 comment_count = 6;
  100. string created_at = 7;
  101. string updated_at = 8;
  102. // 分类id
  103. int64 class_id = 9;
  104. // true 本人已点赞 false 本人未点赞
  105. bool like = 10;
  106. int64 uid = 11;
  107. string user_name = 12;
  108. string user_phone = 13;
  109. // 用户头像
  110. string user_icon = 14;
  111. // 是否是本人发布的文章
  112. bool owner = 15;
  113. string nick_name = 16;
  114. }
  115. message NeighborArticleListRequest {
  116. int64 garden_id = 1;
  117. int64 page = 2;
  118. int64 page_size = 3;
  119. string title = 4;
  120. int64 class_id = 5;
  121. int64 uid = 6;
  122. bool is_me = 7;
  123. }
  124. message NeighborArticleListReply {
  125. int64 page = 1;
  126. int64 total = 2;
  127. repeated NeighborArticleItem list = 3;
  128. }
  129. message NeighborLikeRequest {
  130. int64 garden_id = 1;
  131. int64 uid = 2;
  132. // 点赞id
  133. int64 like_id = 3;
  134. // 点赞类型 1 文章 2 评论
  135. int32 like_type = 4;
  136. // true 点赞 false 取消点赞
  137. bool like = 5;
  138. }
  139. message NeighborLikeReply {
  140. }
  141. // 社区邻里评论
  142. message NeighborCommentAddRequest {
  143. int64 garden_id = 1;
  144. // pid 和 article_id 二选一, 当为文章评论使用article_id, 当为评论添加子评论使用pid
  145. int64 pid = 4;
  146. int64 article_id = 5;
  147. string content = 6;
  148. repeated string pics = 7;
  149. int64 uid = 8;
  150. string user_icon = 9;
  151. string nick_name = 10;
  152. }
  153. message NeighborCommentAddReply {
  154. }
  155. message NeighborCommentDelRequest {
  156. int64 garden_id = 1;
  157. int64 id = 2;
  158. int64 uid = 3;
  159. bool admin = 4;
  160. }
  161. message NeighborCommentDelReply {
  162. }
  163. message NeighborCommentUpdateRequest {
  164. int64 garden_id = 1;
  165. string content = 2;
  166. int64 uid = 3;
  167. int64 id = 4;
  168. repeated string pics = 5;
  169. }
  170. message NeighborCommentUpdateReply {
  171. }
  172. message NeighborCommentListRequest {
  173. int64 garden_id = 1;
  174. int64 article_id = 2;
  175. int64 comment_id = 3;
  176. int64 page = 4;
  177. int64 page_size = 5;
  178. int64 uid = 6;
  179. }
  180. message NeighborCommentItem {
  181. int64 id = 1;
  182. string content = 2;
  183. int64 uid = 3;
  184. string user_name = 4;
  185. string user_phone = 5;
  186. // 用户头像
  187. string user_icon = 6;
  188. repeated string pics = 7;
  189. // 子评论数
  190. int64 sub_comment_count = 8;
  191. // 点赞数
  192. int64 likes = 9;
  193. // 本人是否点赞
  194. bool like = 10;
  195. string created_at = 11;
  196. string updated_at = 12;
  197. // 是否是本人发布的文章
  198. bool owner = 13;
  199. string nick_name = 14;
  200. }
  201. message NeighborCommentListReply {
  202. int64 total = 1;
  203. int64 page = 2;
  204. repeated NeighborCommentItem list = 3;
  205. }