vote.proto 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. syntax = "proto3";
  2. // package声明符,用来防止不同的消息类型有命名冲突
  3. package pb_v1;
  4. // 用于生成指定语言go的包名称
  5. option go_package = "property-applete-gateway/pb/v1";
  6. message VoteTopicChoiceItem {
  7. string flag = 1;
  8. string text = 2;
  9. }
  10. message VoteTopic {
  11. // 题目类型 1 填空题 2 单选题 3 多选题 4 评分题
  12. int32 topic_type = 1;
  13. string topic_name = 2;
  14. // 总星数,当为评分题时有效
  15. int32 star = 3;
  16. // 是否必选
  17. bool must = 4;
  18. // 题目编号
  19. int64 number = 5;
  20. // 选择题的选项
  21. repeated VoteTopicChoiceItem choice_items = 6;
  22. }
  23. message VoteAddRequest {
  24. string title = 1;
  25. repeated string pics = 2;
  26. int64 start = 3;
  27. int64 end = 4;
  28. int64 garden_id = 5;
  29. repeated VoteTopic topics = 6;
  30. }
  31. message VoteAddReply {
  32. }
  33. message VoteUpdateRequest {
  34. int64 id = 1;
  35. string title = 2;
  36. repeated string pics = 3;
  37. int64 start = 4;
  38. int64 end = 5;
  39. int64 garden_id = 6;
  40. repeated VoteTopic topics = 7;
  41. }
  42. message VoteUpdateReply {
  43. }
  44. message VoteDelRequest {
  45. int64 id = 1;
  46. int64 garden_id = 2;
  47. }
  48. message VoteDelReply {
  49. }
  50. message VoteListRequest {
  51. int64 garden_id = 1;
  52. string title = 2;
  53. int64 page = 3;
  54. int64 page_size = 4;
  55. }
  56. message VoteItem {
  57. string title = 1;
  58. repeated string pics = 2;
  59. int64 start = 3;
  60. int64 end = 4;
  61. int64 id = 5;
  62. int64 created_at = 6;
  63. repeated VoteTopic topics = 7;
  64. int64 user_count = 8;
  65. }
  66. message VoteListReply {
  67. int64 total = 1;
  68. int64 page = 2;
  69. repeated VoteItem list = 3;
  70. }
  71. message VoteTopicAnswer {
  72. // 题目编号
  73. int64 number = 1;
  74. // 题目类型
  75. int32 topic_type = 2;
  76. // 问答题回答,当题目类型为问答题时有效
  77. repeated string completion_answers = 3;
  78. // 选择题回答,当题目类型为选择题时有效
  79. repeated string choice_answers = 4;
  80. // 评分题回答,当题目类型为评分题时有效
  81. int32 star_answers = 5;
  82. }
  83. message VoteAddAnswerRequest {
  84. int64 id = 1;
  85. int64 garden_id = 2;
  86. int64 uid = 3;
  87. repeated VoteTopicAnswer answers = 4;
  88. }
  89. message VoteAddAnswerReply {
  90. }
  91. message VoteResultListRequest {
  92. int64 id = 1;
  93. int64 garden_id = 2;
  94. int64 page = 3;
  95. int64 page_size = 4;
  96. }
  97. message VoteResultData {
  98. // 题目类型 1 填空题 2 单选题 3 多选题 4 评分题
  99. int32 topic_type = 1;
  100. string topic_name = 2;
  101. // 总星数,当为评分题时有效
  102. int32 star = 3;
  103. // 是否必选
  104. bool must = 4;
  105. // 题目编号
  106. int64 number = 5;
  107. // 选择题的选项
  108. repeated VoteTopicChoiceItem choice_items = 6;
  109. // 问答题回答,当题目类型为问答题时有效
  110. repeated string completion_answers = 7;
  111. // 选择题回答,当题目类型为选择题时有效
  112. repeated string choice_answers = 8;
  113. // 评分题回答,当题目类型为评分题时有效
  114. int32 star_answers = 9;
  115. }
  116. message VoteResultUserAnswerItem {
  117. // 用户uid
  118. int64 uid = 1;
  119. repeated VoteResultData answers = 2;
  120. }
  121. message VoteResultListReply {
  122. int64 page = 1;
  123. int64 total = 2;
  124. repeated VoteResultUserAnswerItem list = 3;
  125. }
  126. message VoteResultStatisticRequest {
  127. int64 id = 1;
  128. int64 garden_id = 2;
  129. }
  130. message VoteResultStatisticChoice {
  131. // 选择选项标识
  132. string flag = 1;
  133. // 该选项被选的用户
  134. int32 count = 2;
  135. }
  136. message VoteResultStatisticStar {
  137. // 评分星数
  138. int32 star = 1;
  139. // 评该星数的用户数量
  140. int32 count = 2;
  141. }
  142. message VoteResultStatisticItem {
  143. // 题目类型 1 填空题 2 单选题 3 多选题 4 评分题
  144. int32 topic_type = 1;
  145. string topic_name = 2;
  146. // 总星数,当为评分题时有效
  147. int32 star = 3;
  148. // 是否必选
  149. bool must = 4;
  150. // 题目编号
  151. int64 number = 5;
  152. // 选择题的选项内容
  153. repeated VoteTopicChoiceItem choice_items = 6;
  154. // 选择题的选项回答统计,当题目类型为选择题时有效
  155. repeated VoteResultStatisticChoice choice_statistic = 7;
  156. // 评分题的分数回答统计,当题目类型为评分题时有效
  157. repeated VoteResultStatisticStar star_statistic = 8;
  158. // 平均分, 当题目类型为评分题时有效
  159. int32 star_avg = 9;
  160. }
  161. message VoteResultStatisticReply {
  162. // 题目统计
  163. repeated VoteResultStatisticItem list = 1;
  164. }