vote.go 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. package v1
  2. import (
  3. "property-applete-gateway/param/base"
  4. "property-applete-gateway/pb/v1"
  5. )
  6. type VoteTopicChoiceItem struct {
  7. // 选项标识 如A,B,C,D
  8. Flag string `form:"flag" json:"flag"`
  9. // 选项内容
  10. Text string `form:"text" json:"text"`
  11. }
  12. type VoteTopic struct {
  13. // 题目类型 1 填空题 2 单选题 3 多选题 4 评分题
  14. TopicType int32 `form:"topic_type" json:"topic_type"`
  15. TopicName string `form:"topic_name" json:"topic_name"`
  16. // 总星数,当为评分题时有效
  17. Star int32 `form:"star" json:"star"`
  18. // 是否必选
  19. Must bool `form:"must" json:"must"`
  20. // 题目编号
  21. Number int64 `form:"name" json:"number"`
  22. // 选择题的选项
  23. ChoiceItems []VoteTopicChoiceItem `form:"choice_items" json:"choice_items"`
  24. }
  25. type VoteAddBody struct {
  26. // 投票标题
  27. Title string `form:"title" json:"title"`
  28. // 图片
  29. Pics []string `form:"pics" json:"pics"`
  30. // 投票开始时间
  31. Start int64 `form:"start" json:"start"`
  32. // 投票结束时间
  33. End int64 `form:"end" json:"end"`
  34. // 投票题目列表
  35. Topics []VoteTopic `form:"topics" json:"topics"`
  36. }
  37. type VoteAddRequest struct {
  38. base.Header
  39. VoteAddBody
  40. }
  41. type VoteAddResponse struct {
  42. base.Result
  43. }
  44. type VoteUpdateBody struct {
  45. // 投票id
  46. Id int64 `form:"id" json:"id"`
  47. // 投票标题
  48. Title string `form:"title" json:"title"`
  49. // 图片
  50. Pics []string `form:"pics" json:"pics"`
  51. // 投票开始时间
  52. Start int64 `form:"start" json:"start"`
  53. // 投票结束时间
  54. End int64 `form:"end" json:"end"`
  55. // 投票题目列表
  56. Topics []VoteTopic `form:"topics" json:"topics"`
  57. }
  58. type VoteUpdateRequest struct {
  59. base.Header
  60. VoteUpdateBody
  61. }
  62. type VoteUpdateResponse struct {
  63. base.Result
  64. }
  65. type VoteDelQuery struct {
  66. // 投票id
  67. Id int64 `form:"id" json:"id"`
  68. }
  69. type VoteDelRequest struct {
  70. base.Header
  71. VoteDelQuery
  72. }
  73. type VoteDelResponse struct {
  74. base.Result
  75. }
  76. type VoteListQuery struct {
  77. Page int64 `form:"page" json:"page"`
  78. PageSize int64 `form:"page_size" json:"page_size"`
  79. Title string `form:"title" json:"title"`
  80. }
  81. type VoteListRequest struct {
  82. base.Header
  83. VoteListQuery
  84. }
  85. type VoteListResponse struct {
  86. base.Result
  87. Data v1.VoteListReply `json:"data"`
  88. }
  89. type VoteResultListQuery struct {
  90. Page int64 `form:"page" json:"page"`
  91. PageSize int64 `form:"page_size" json:"page_size"`
  92. // 投票id
  93. Id int64 `form:"id" json:"id"`
  94. }
  95. type VoteResultListRequest struct {
  96. base.Header
  97. VoteResultListQuery
  98. }
  99. type VoteResultListResponse struct {
  100. base.Result
  101. Data v1.VoteResultListReply `json:"data"`
  102. }
  103. type VoteResultStatisticQuery struct {
  104. // 投票id
  105. Id int64 `form:"id" json:"id"`
  106. }
  107. type VoteResultStatisticRequest struct {
  108. base.Header
  109. VoteResultStatisticQuery
  110. }
  111. type VoteResultStatisticResponse struct {
  112. base.Result
  113. Data v1.VoteResultStatisticReply `json:"data"`
  114. }