report.go 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. package model
  2. import xtime "go-common/library/time"
  3. var (
  4. // DateFormat date time format
  5. DateFormat = "2006-01-02 15:04:05"
  6. // DateSimpleFormat date simple format
  7. DateSimpleFormat = "2006-01-02"
  8. )
  9. const (
  10. // ReportStateNew 待一审
  11. ReportStateNew = int32(0)
  12. // ReportStateDelete 移除
  13. ReportStateDelete = int32(1)
  14. // ReportStateIgnore 忽略
  15. ReportStateIgnore = int32(2)
  16. // ReportStateDelete1 一审移除
  17. ReportStateDelete1 = int32(3)
  18. // ReportStateNew2 待二审
  19. ReportStateNew2 = int32(4)
  20. // ReportStateDelete2 二审移除
  21. ReportStateDelete2 = int32(5)
  22. // ReportStateIgnore2 二审忽略
  23. ReportStateIgnore2 = int32(6)
  24. // ReportStateIgnore1 一审忽略
  25. ReportStateIgnore1 = int32(7)
  26. // ReportStateTransferred 举报转移风纪委
  27. ReportStateTransferred = int32(8)
  28. // ReportUserStateNew 新增
  29. ReportUserStateNew = int32(0)
  30. // ReportUserStateReported 已反馈
  31. ReportUserStateReported = int32(1)
  32. // ReportAttrTransferred 是否从待一审\二审转换成待二审\一审
  33. ReportAttrTransferred = uint32(0)
  34. // AuditTypeFirst 一审
  35. AuditTypeFirst = int32(1)
  36. // AuditTypeSecond 二审
  37. AuditTypeSecond = int32(2)
  38. // ReportActionReplyPass action reply_pass
  39. ReportActionReplyPass = "reply_pass"
  40. // ReportActionReplyDel action reply_del
  41. ReportActionReplyDel = "reply_del"
  42. // ReportActionReplyEdit action reply_edit
  43. ReportActionReplyEdit = "reply_edit"
  44. // ReportActionReplyRecover action reply_recover
  45. ReportActionReplyRecover = "reply_recover"
  46. // ReportActionReplyTop action 置顶
  47. ReportActionReplyTop = "top"
  48. // ReportActionReplyMonitor action 监控
  49. ReportActionReplyMonitor = "monitor"
  50. // ReportActionReplyGarbage action reply_garbage
  51. ReportActionReplyGarbage = "reply_garbage"
  52. // ReportActionReportIgnore1 action report_ignore_1
  53. ReportActionReportIgnore1 = "report_ignore_1"
  54. // ReportActionReportIgnore2 action report_ignore_2
  55. ReportActionReportIgnore2 = "report_ignore_2"
  56. // ReportActionReportDel1 action report_del_1
  57. ReportActionReportDel1 = "report_del_1"
  58. // ReportActionReportDel2 action report_del_2
  59. ReportActionReportDel2 = "report_del_2"
  60. // ReportActionReport1To2 action report_1to2
  61. ReportActionReport1To2 = "report_1to2"
  62. // ReportActionReport2To1 action report_2to1
  63. ReportActionReport2To1 = "report_2to1"
  64. // ReportActionReportArbitration action 众裁
  65. ReportActionReportArbitration = "report_arbitration"
  66. )
  67. // Report report info.
  68. type Report struct {
  69. ID int64 `json:"id"`
  70. RpID int64 `json:"rpid"`
  71. Oid int64 `json:"oid"`
  72. Type int32 `json:"type"`
  73. Mid int64 `json:"mid"`
  74. Reason int32 `json:"reason"`
  75. Content string `json:"content"`
  76. Count int32 `json:"count"`
  77. Score int `json:"score"`
  78. State int32 `json:"state"`
  79. CTime xtime.Time `json:"ctime"`
  80. MTime xtime.Time `json:"mtime"`
  81. Attr uint32 `json:"attr"`
  82. ReplyCtime xtime.Time `json:"-"`
  83. }
  84. // AttrVal return attr val.
  85. func (r *Report) AttrVal(bit uint32) uint32 {
  86. return (r.Attr >> bit) & uint32(1)
  87. }
  88. // AttrSet set attr of ReplyReport'attr
  89. func (r *Report) AttrSet(v uint32, bit uint32) {
  90. r.Attr = r.Attr&(^(1 << bit)) | (v << bit)
  91. }
  92. // SearchReportParams search params.
  93. type SearchReportParams struct {
  94. Type int32
  95. Oid int64
  96. UID int64
  97. StartTime string
  98. EndTime string
  99. Reason string
  100. Typeids string
  101. Keyword string
  102. Nickname string
  103. States string
  104. Order string
  105. Sort string
  106. }
  107. // ReportUser report user.
  108. type ReportUser struct {
  109. ID int64 `json:"id"`
  110. Oid int64 `json:"oid"`
  111. Type int8 `json:"type"`
  112. RpID int64 `json:"rpid"`
  113. Mid int64 `json:"mid"`
  114. Reason int32 `json:"reason"`
  115. Content string `json:"content"`
  116. State int32 `json:"state"`
  117. CTime xtime.Time `json:"ctime"`
  118. MTime xtime.Time `json:"mtime"`
  119. }
  120. // SearchReport search report.
  121. type SearchReport struct {
  122. ID int64 `json:"id"`
  123. Oid int64 `json:"oid"`
  124. OidStr string `json:"oid_str"`
  125. Type int8 `json:"type"`
  126. RpID int64 `json:"rpid"`
  127. Mid int64 `json:"mid"`
  128. Reason int8 `json:"reason"`
  129. Content string `json:"content"`
  130. State int8 `json:"state"`
  131. CTime string `json:"ctime"`
  132. MTime string `json:"mtime"`
  133. Parent int64 `json:"parent"`
  134. Like int64 `json:"like"`
  135. ReplyState int64 `json:"reply_state"`
  136. Opremark string `json:"opremark"`
  137. Count int64 `json:"count"`
  138. Message string `json:"message"`
  139. Title string `json:"title"`
  140. Opresult string `json:"opresult"`
  141. ReplyMid int64 `json:"reply_mid"`
  142. Floor int64 `json:"floor"`
  143. Root int64 `json:"root"`
  144. ReportMid int64 `json:"report_mid"`
  145. ArcMid int64 `json:"arc_mid"`
  146. Reporter string `json:"reporter"`
  147. Replier string `json:"replier"`
  148. IsUp int64 `json:"is_up"`
  149. AdminID int64 `json:"adminid"`
  150. AdminName string `json:"admin_name"`
  151. Opctime string `json:"opctime"`
  152. DocID string `json:"doc_id"`
  153. Score int64 `json:"score"`
  154. Attr []int8 `json:"attr"`
  155. RedirectURL string `json:"redirect_url"`
  156. }
  157. // SearchReportResult search result.
  158. type SearchReportResult struct {
  159. Code int `json:"code,omitempty"`
  160. Page int64 `json:"page"`
  161. PageSize int64 `json:"pagesize"`
  162. PageCount int `json:"pagecount"`
  163. Total int64 `json:"total"`
  164. Order string `json:"order"`
  165. Result []*SearchReport `json:"result"`
  166. Message string `json:"msg,omitempty"`
  167. }
  168. // ReportSearchResponse search result.
  169. type ReportSearchResponse struct {
  170. SearchReportResult
  171. Pager Pager `json:"pager"`
  172. }