answer.go 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. package model
  2. import (
  3. "time"
  4. )
  5. // answer constants
  6. const (
  7. LangZhCN = "zh-CN"
  8. LangZhTW = "zh-TW"
  9. LangZhHK = "zh-HK"
  10. )
  11. // answer constants
  12. const (
  13. UserInfoRank = 5000
  14. PenDantDays = 7 //答题优秀设置挂件的天数
  15. ExtraAnsA = "符合规范"
  16. ExtraAnsB = "不符合规范"
  17. )
  18. // Score info.
  19. const (
  20. FullScore = 100
  21. Score85 = 85
  22. Score60 = 60
  23. Score0 = 0
  24. )
  25. // Rank info.
  26. const (
  27. RankTop int = 122
  28. )
  29. // question type.
  30. const (
  31. Q int8 = iota
  32. BaseExtraNoPassQ // 1 extra no pass
  33. BaseExtraPassQ // 2 extra pass
  34. )
  35. // extra question ans.
  36. const (
  37. UnKownQ int8 = iota
  38. ViolationQ
  39. NormalQ
  40. )
  41. // answer captcha pass
  42. const (
  43. CaptchaNopass int8 = iota
  44. CaptchaPass
  45. )
  46. // BaseQues question record
  47. type BaseQues struct {
  48. Question string
  49. Check int8
  50. Ctime time.Time
  51. }
  52. // MyQues my question
  53. type MyQues struct {
  54. Count int64
  55. List []*BaseQues
  56. }
  57. // RankInfo rank
  58. type RankInfo struct {
  59. Mid int64 `json:"mid"`
  60. Face string `json:"face"`
  61. Uname string `json:"uname"`
  62. Num int64 `json:"num"`
  63. Nameplate *NameplateInfo `json:"nameplate"`
  64. }
  65. // NameplateInfo .
  66. type NameplateInfo struct {
  67. Nid int `json:"nid"`
  68. Name string `json:"name"`
  69. Image string `json:"image"`
  70. ImageSmall string `json:"image_small"`
  71. Level string `json:"level"`
  72. Condition string `json:"condition"`
  73. }
  74. // TypeInfo type info
  75. type TypeInfo struct {
  76. ID, Parentid int64
  77. Name string
  78. LabelName string
  79. Subs []*SubType
  80. }
  81. // ProTypes .
  82. type ProTypes struct {
  83. List []*TypeInfo
  84. CurrentTime, EndTime time.Time
  85. Repro bool
  86. }
  87. // SubType sub type info
  88. type SubType struct {
  89. ID int64 `json:"id"`
  90. Name string `json:"name"`
  91. LabelName string `json:"-"`
  92. }
  93. // AnsQue .
  94. type AnsQue struct {
  95. ID int64
  96. Img string
  97. Height float64
  98. PositionY float64 // background-position-y
  99. Ans []*AnsPosition
  100. }
  101. // AnsPosition .
  102. type AnsPosition struct {
  103. AnsHash string
  104. Height float64 // height
  105. PositionY float64 // background-position-y
  106. }
  107. // AnsQuesList .
  108. type AnsQuesList struct {
  109. CurrentTime, EndTime time.Time
  110. QuesList []*AnsQue
  111. }
  112. // AnsCheck .
  113. type AnsCheck struct {
  114. QidList []int64
  115. HistoryID int64
  116. Pass bool
  117. }
  118. // CaptchaReq Captcha request.
  119. type CaptchaReq struct {
  120. Mid int64
  121. IP string
  122. ClientType string
  123. NewCaptcha int
  124. }
  125. // CaptchaCheckReq Captcha check request.
  126. type CaptchaCheckReq struct {
  127. Mid int64
  128. IP string
  129. Challenge string
  130. ClientType string
  131. Validate string
  132. Seccode string
  133. Success int
  134. Cookie string
  135. Comargs map[string]string
  136. }
  137. // QueReq request
  138. type QueReq struct {
  139. ID int64
  140. }
  141. // AnsCool .
  142. type AnsCool struct {
  143. Hid int64 `json:"hid,omitempty"`
  144. URL string `json:"url,omitempty"`
  145. Name string `json:"uname"`
  146. Face string `json:"face"`
  147. Powers []*CoolPower `json:"power_result"`
  148. Score int8 `json:"score"`
  149. Rank *CoolRank `json:"rank"`
  150. Share *CoolShare `json:"share"`
  151. CanShowRankBtn bool `json:"can_show_rank_btn"`
  152. IsSameUser bool `json:"is_same_user"`
  153. ViewMore string `json:"view_more"`
  154. VideoInfo *CoolVideo `json:"video_info"`
  155. IsFirstPass int8 `json:"is_first_pass"`
  156. Level int8 `json:"level"`
  157. MainTids []int `json:"main_tids"`
  158. SubTids []int `json:"sub_tids"`
  159. }
  160. // CoolPower .
  161. type CoolPower struct {
  162. Num int64 `json:"num"`
  163. Name string `json:"name"`
  164. }
  165. // CoolRank .
  166. type CoolRank struct {
  167. ID int `json:"id"`
  168. Name string `json:"name"`
  169. Img string `json:"img"`
  170. }
  171. // CoolShare .
  172. type CoolShare struct {
  173. Content string `json:"content"`
  174. ShortContent string `json:"short_content"`
  175. }
  176. // CoolVideo .
  177. type CoolVideo struct {
  178. URL string `json:"url"`
  179. Name string `json:"name"`
  180. Img string `json:"img"`
  181. WatchNum string `json:"watch_num"`
  182. UpNum string `json:"up_num"`
  183. }
  184. // AnswerHistory info.
  185. type AnswerHistory struct {
  186. ID int64 `json:"id"`
  187. Hid int64 `json:"hid"`
  188. Mid int64 `json:"mid"`
  189. StartTime time.Time `json:"start_time"`
  190. StepOneErrTimes int8 `json:"step_one_err_times"`
  191. StepOneCompleteTime int64 `json:"step_one_complete_time"`
  192. StepExtraStartTime time.Time `json:"step_extra_start_time"`
  193. StepExtraCompleteTime int64 `json:"step_extra_complete_time"`
  194. StepExtraScore int64 `json:"step_extra_score"`
  195. StepTwoStartTime time.Time `json:"step_two_start_time"`
  196. CompleteTime time.Time `json:"complete_time"`
  197. CompleteResult string `json:"complete_result"`
  198. Score int8 `json:"score"`
  199. IsFirstPass int8 `json:"is_first_pass"`
  200. IsPassCaptcha int8 `json:"is_pass_captcha"`
  201. PassedLevel int8 `json:"passed_level"`
  202. RankID int `json:"rank_id"`
  203. Ctime time.Time `json:"ctime"`
  204. Mtime time.Time `json:"mtime"`
  205. }
  206. // AnswerTime info.
  207. type AnswerTime struct {
  208. Stime time.Time `json:"stime"` // answer start time
  209. Etimes int8 `json:"etimes"` // base answer error times
  210. }
  211. // AnsHash .
  212. type AnsHash struct {
  213. AnsHashName string
  214. AnsHashVal string
  215. }
  216. // ExtraScoreReply .
  217. type ExtraScoreReply struct {
  218. Score int64 `json:"score"`
  219. }