comment.go 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. package model
  2. import (
  3. user "go-common/app/service/bbq/user/api"
  4. xtime "go-common/library/time"
  5. )
  6. const (
  7. //DefaultCmType bbq评论区
  8. DefaultCmType = 23
  9. )
  10. // Int64Bytes implements the Scanner interface.
  11. type Int64Bytes []int64
  12. // Mstr Mstr
  13. type Mstr []string
  14. // ReplyCount /mcounts 返回字段
  15. type ReplyCount struct {
  16. SubState int64 `json:"sub_state"`
  17. Count int64 `json:"count"`
  18. }
  19. // ReplyList /reply 返回字段
  20. type ReplyList struct {
  21. Page struct {
  22. Num int `json:"num"`
  23. Size int `json:"size"`
  24. Count int `json:"count"`
  25. Acount int `json:"acount"`
  26. }
  27. Config struct {
  28. ShowEntry int `json:"showentry"`
  29. ShowAdmin int `json:"showadmin"`
  30. }
  31. Replies []*Reply `json:"replies,omitempty"`
  32. Hots []*Reply `json:"hots,omitempty"`
  33. Upper struct {
  34. MID int64 `json:"mid"`
  35. Top *Reply `json:"top,omitempty"`
  36. }
  37. Top *Reply `json:"top,omitempty"`
  38. Notice *Notice `json:"notice,omitempty"`
  39. BlackList int16 `json:"blacklist"`
  40. Assist int16 `json:"assist"`
  41. }
  42. // Reply .
  43. type Reply struct {
  44. RpID int64 `json:"rpid"`
  45. Oid uint64 `json:"oid"`
  46. Type int8 `json:"type"`
  47. Mid int64 `json:"mid"`
  48. Root int64 `json:"root"`
  49. Parent int64 `json:"parent"`
  50. Dialog int64 `json:"dialog"`
  51. Count int `json:"count"`
  52. RCount int `json:"rcount"`
  53. Floor int `json:"floor"`
  54. State int8 `json:"state"`
  55. FansGrade int8 `json:"fansgrade"`
  56. Attr int8 `json:"attr"`
  57. CTime xtime.Time `json:"ctime"`
  58. MTime xtime.Time `json:"-"`
  59. // string
  60. RpIDStr string `json:"rpid_str"`
  61. RootStr string `json:"root_str"`
  62. ParentStr string `json:"parent_str"`
  63. DialogStr string `json:"dialog_str"`
  64. // action count, from ReplyAction count
  65. Like int `json:"like"`
  66. Hate int `json:"-"`
  67. Action int8 `json:"action"`
  68. // member info
  69. Member *Member `json:"member,omitempty"`
  70. // other
  71. Content *Content `json:"content,omitempty"`
  72. Replies []*Reply `json:"replies,omitempty"`
  73. Assist int `json:"assist"`
  74. }
  75. // Content .
  76. type Content struct {
  77. RpID int64 `json:"-"`
  78. Message string `json:"message"`
  79. Ats Int64Bytes `json:"ats"`
  80. Topics Mstr `json:"topics"`
  81. IP uint32 `json:"ipi"`
  82. Plat int8 `json:"plat"`
  83. Device string `json:"device"`
  84. Version string `json:"version"`
  85. CTime xtime.Time `json:"-"`
  86. MTime xtime.Time `json:"-"`
  87. // ats member info
  88. Members []*Info `json:"members,omitempty"`
  89. }
  90. // Info Info
  91. type Info struct {
  92. Mid string `json:"mid"`
  93. Name string `json:"uname"`
  94. Sex string `json:"sex"`
  95. Sign string `json:"sign"`
  96. Avatar string `json:"avatar"`
  97. Rank string `json:"rank"`
  98. DisplayRank string `json:"DisplayRank"`
  99. LevelInfo struct {
  100. Cur int `json:"current_level"`
  101. Min int `json:"current_min"`
  102. NowExp int `json:"current_exp"`
  103. NextExp int `json:"next_exp"`
  104. } `json:"level_info"`
  105. Pendant PendantInfo `json:"pendant"`
  106. Nameplate NameplateInfo `json:"nameplate"`
  107. OfficialVerify struct {
  108. Type int `json:"type"`
  109. Desc string `json:"desc"`
  110. } `json:"official_verify"`
  111. Vip struct {
  112. Type int `json:"vipType"`
  113. DueDate int64 `json:"vipDueDate"`
  114. DueRemark string `json:"dueRemark"`
  115. AccessStatus int `json:"accessStatus"`
  116. VipStatus int `json:"vipStatus"`
  117. VipStatusWarn string `json:"vipStatusWarn"`
  118. } `json:"vip"`
  119. BInfo *user.UserBase `json:"b_info,omitempty"`
  120. }
  121. // Member .
  122. type Member struct {
  123. Mid string `json:"mid"`
  124. Name string `json:"uname"`
  125. Sex string `json:"sex"`
  126. Sign string `json:"sign"`
  127. Avatar string `json:"avatar"`
  128. Rank string `json:"rank"`
  129. DisplayRank string `json:"DisplayRank"`
  130. LevelInfo struct {
  131. CurrentLevel int `json:"current_level"`
  132. Min int `json:"current_min"`
  133. NowExp int `json:"current_exp"`
  134. NextExp int `json:"next_exp"`
  135. } `json:"level_info"`
  136. Pendant PendantInfo `json:"pendant"`
  137. Nameplate NameplateInfo `json:"nameplate"`
  138. OfficialVerify struct {
  139. Type int `json:"type"`
  140. Desc string `json:"desc"`
  141. } `json:"official_verify"`
  142. Vip struct {
  143. Type int `json:"vipType"`
  144. DueDate int64 `json:"vipDueDate"`
  145. DueRemark string `json:"dueRemark"`
  146. AccessStatus int `json:"accessStatus"`
  147. VipStatus int `json:"vipStatus"`
  148. VipStatusWarn string `json:"vipStatusWarn"`
  149. } `json:"vip"`
  150. FansDetail *FansDetail `json:"fans_detail,omitempty"`
  151. Following int16 `json:"following"` //是否关注
  152. BInfo *user.UserBase `json:"b_info,omitempty"`
  153. }
  154. // FansDetail .
  155. type FansDetail struct {
  156. UID int64 `json:"uid"`
  157. MedalID int32 `json:"medal_id"` //勋章id
  158. MedalName string `json:"medal_name"` //勋章名称
  159. Score int32 `json:"score"` //当前总经验值
  160. Level int8 `json:"level"` //level等级
  161. Intimacy int32 `json:"intimacy"` //当前亲密度
  162. Status int8 `json:"master_status"` //佩戴状态1:佩戴中0:未佩戴
  163. Received int8 `json:"is_receive"` //是否领取0:未领取1:已领取
  164. }
  165. // NameplateInfo .
  166. type NameplateInfo struct {
  167. Nid int `json:"nid"`
  168. Name string `json:"name"`
  169. Image string `json:"image"`
  170. ImageSmall string `json:"image_small"`
  171. Level string `json:"level"`
  172. Condition string `json:"condition"`
  173. }
  174. // PendantInfo .
  175. type PendantInfo struct {
  176. PID int `json:"pid"`
  177. Name string `json:"name"`
  178. Image string `json:"image"`
  179. Expire int `json:"expire"`
  180. }
  181. //AddRes 添加评论返回字段
  182. type AddRes struct {
  183. RpID int64 `json:"rpid"`
  184. NeedCaptcha bool `json:"need_captcha"`
  185. URL string `json:"url"`
  186. }
  187. //CursorRes /reply/cusor response
  188. type CursorRes struct {
  189. Assist int64 `json:"assist"`
  190. BlackList int64 `json:"blacklist"`
  191. Replies []*Reply `json:"replies,omitempty"`
  192. Upper *Upper `json:"upper,omitempty"`
  193. Cursor *Cursor `json:"cursor,omitempty"`
  194. Config *Config `json:"config,omitempty"`
  195. Hots []*Reply `json:"hots,omitempty"`
  196. Notice *Notice `json:"notice,omitempty"`
  197. Top *Top `json:"top,omitempty"`
  198. }
  199. //SubCursorRes /reply/reply/cusor response
  200. type SubCursorRes struct {
  201. Assist int64 `json:"assist"`
  202. BlackList int64 `json:"blacklist"`
  203. Root *Reply `json:"root,omitempty"`
  204. Upper *Upper `json:"upper,omitempty"`
  205. Cursor *Cursor `json:"cursor,omitempty"`
  206. }
  207. // Notice Notice
  208. type Notice struct {
  209. ID int64 `json:"id"`
  210. Plat int8 `json:"-"`
  211. Condition int8 `json:"-"`
  212. Build int64 `json:"-"`
  213. Title string `json:"title"`
  214. Content string `json:"content"`
  215. Link string `json:"link"`
  216. ClientType string `json:"-"`
  217. }
  218. //Top .
  219. type Top struct {
  220. Admin *Reply `json:"admin,omitempty"`
  221. Upper *Reply `json:"upper,omitempty"`
  222. }
  223. //Config .
  224. type Config struct {
  225. ShowEntry int16 `json:"showentry"`
  226. ShowAdmin int16 `json:"showadmin"`
  227. }
  228. //Cursor .
  229. type Cursor struct {
  230. ACount int64 `json:"all_count"`
  231. CursorRangeMax int64 `json:"max_id"`
  232. CursorRangeMin int64 `json:"min_id"`
  233. Size int64 `json:"size"`
  234. }
  235. //Upper .
  236. type Upper struct {
  237. MID int64 `json:"mid"`
  238. }