subject.go 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. package like
  2. import (
  3. xtime "go-common/library/time"
  4. )
  5. // Subject type.
  6. const (
  7. VIDEO = 1
  8. PICTURE = 2
  9. DRAWYOO = 3
  10. VIDEOLIKE = 4
  11. PICTURELIKE = 5
  12. DRAWYOOLIKE = 6
  13. TEXT = 7
  14. TEXTLIKE = 8
  15. ONLINEVOTE = 9
  16. QUESTION = 10
  17. LOTTERY = 11
  18. ARTICLE = 12
  19. VIDEO2 = 13
  20. MUSIC = 15
  21. PHONEVIDEO = 16
  22. SMALLVIDEO = 17
  23. RESERVATION = 18
  24. MISSIONGROUP = 19
  25. STORYKING = 20
  26. FLAGFIRST = 1
  27. FLAGSPY = 2
  28. FLAGUSTIME = 4
  29. FLAGUETIME = 8
  30. FLAGLEVEL = 16
  31. FLAGIP = 32
  32. FLAGRANKCLOSE = 64
  33. FLAGPHONEBIND = 128
  34. )
  35. // Subject group type
  36. var (
  37. VIDEOALL = []int64{VIDEO, VIDEOLIKE, VIDEO2, PHONEVIDEO, SMALLVIDEO}
  38. LIKETYPE = []int64{VIDEOLIKE, PICTURELIKE, DRAWYOOLIKE, TEXTLIKE}
  39. )
  40. // Subject struct
  41. type Subject struct {
  42. ID int64 `json:"id"`
  43. Name string `json:"name"`
  44. Dic string `json:"dic"`
  45. Cover string `json:"cover"`
  46. Stime xtime.Time `json:"stime"`
  47. Interval int32 `json:"interval"`
  48. Tlimit int32 `json:"tlimit"`
  49. Ltime int32 `json:"ltime"`
  50. List []*Like `json:"list"`
  51. }
  52. // SubItem .
  53. type SubItem struct {
  54. ID int64 `json:"id"`
  55. Ctime xtime.Time `json:"ctime"`
  56. }
  57. // SubjectStat .
  58. type SubjectStat struct {
  59. Sid int64 `json:"sid" form:"sid" validate:"min=1"`
  60. Count int64 `json:"count" form:"count"`
  61. View int64 `form:"view" form:"view"`
  62. Like int64 `form:"like" form:"like"`
  63. Fav int64 `form:"fav" form:"fav"`
  64. Coin int64 `form:"coin" form:"coin"`
  65. }
  66. // SubjectScore .
  67. type SubjectScore struct {
  68. Score int64 `json:"score"`
  69. }
  70. // Page .
  71. type Page struct {
  72. Num int `json:"num"`
  73. Size int `json:"size"`
  74. Total int64 `json:"total"`
  75. }
  76. // SubProtocol .
  77. type SubProtocol struct {
  78. *SubjectItem
  79. *ActSubjectProtocol
  80. }