likes.go 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. package model
  2. import (
  3. xtime "go-common/library/time"
  4. )
  5. // LikesParam def.
  6. type LikesParam struct {
  7. Sid int64 `form:"sid" validate:"min=1"`
  8. Mid int64 `form:"mid"`
  9. Wid int64 `form:"wid"`
  10. Page int `form:"page" default:"1" validate:"min=1"`
  11. PageSize int `form:"pagesize" default:"15" validate:"min=1"`
  12. States []int `form:"state,split"`
  13. }
  14. // AddLikes .
  15. type AddLikes struct {
  16. DealType string `form:"deal_type" validate:"required"`
  17. Wid int64 `form:"wid"`
  18. Sid int64 `form:"sid" validate:"min=1"`
  19. Type int `form:"type"`
  20. Mid int64 `form:"mid"`
  21. State int `form:"state"`
  22. Plat int `form:"plat"`
  23. Device int `form:"device"`
  24. }
  25. // UpReply .
  26. type UpReply struct {
  27. State int `form:"state"`
  28. Reply string `form:"reply"`
  29. IDs []int64 `form:"ids,split" validate:"min=1,max=50"`
  30. }
  31. // UpWid .
  32. type UpWid struct {
  33. Sid int64 `form:"sid" validate:"min=1"`
  34. Wid int64 `form:"wid" validate:"min=1"`
  35. State int `form:"state"`
  36. }
  37. // BatchLike .
  38. type BatchLike struct {
  39. Sid int64 `form:"sid" validate:"min=1"`
  40. Wid []int64 `form:"wid,split" validate:"min=1,max=200,dive,gt=0"`
  41. Mid int64 `form:"mid"`
  42. Type int `form:"type"`
  43. }
  44. // AddPic .
  45. type AddPic struct {
  46. Sid int64 `form:"sid" validate:"min=1"`
  47. Type int `form:"type"`
  48. Mid int64 `form:"mid"`
  49. Wid int64 `form:"wid"`
  50. Plat int `form:"plat"`
  51. Device int `form:"device"`
  52. Image string `form:"image"`
  53. Message string `form:"message" validate:"required,max=450,min=1"`
  54. Link string `form:"link"`
  55. }
  56. // UpLike .
  57. type UpLike struct {
  58. Type int `form:"type"`
  59. Mid int64 `form:"mid"`
  60. Wid int64 `form:"wid"`
  61. State int `form:"state"`
  62. StickTop int `form:"stick_top"`
  63. Lid int64 `form:"lid" validate:"min=1"`
  64. Message string `form:"message"`
  65. Reply string `form:"reply"`
  66. Link string `form:"link"`
  67. Image string `form:"image"`
  68. }
  69. // ActivityAVInfo active_id -> avid
  70. type ActivityAVInfo struct {
  71. ActivityID int64 `json:"mission_id"`
  72. AVID int64 `json:"id"`
  73. MID int64 `json:"mid"`
  74. Category int `json:"typeid"`
  75. TagID int64 `json:"-"`
  76. Ratio int `json:"-"`
  77. }
  78. // LikeContent def
  79. type LikeContent struct {
  80. ID int64 `json:"id" form:"id" gorm:"column:id"`
  81. Message string `json:"message" form:"message"`
  82. IP int64 `json:"ip" form:"ip" gorm:"column:ip"`
  83. Plat int `json:"plat" form:"plat"`
  84. Device int `json:"device" form:"device"`
  85. Ctime xtime.Time `json:"ctime" form:"ctime" time_format:"2006-01-02 15:04:05"`
  86. Mtime xtime.Time `json:"mtime" form:"mtime" time_format:"2006-01-02 15:04:05"`
  87. Image string `json:"image" form:"image"`
  88. Reply string `json:"reply" form:"reply"`
  89. Link string `json:"link" form:"link"`
  90. ExName string `json:"ex_name" form:"ex_name"`
  91. IPv6 []byte `json:"ipv6" gorm:"column:ipv6"`
  92. }
  93. //ActLikeLog def
  94. type ActLikeLog struct {
  95. ID int64 `json:"id" form:"id" gorm:"column:id"`
  96. Lid int64 `json:"lid" form:"lid" gorm:"column:lid"`
  97. User string `json:"user" form:"user" gorm:"column:user"`
  98. State int64 `json:"state" form:"state" gorm:"column:state"`
  99. Ctime xtime.Time `json:"ctime" form:"ctime" gorm:"column:ctime" time_format:"2006-01-02 15:04:05"`
  100. Mtime xtime.Time `json:"mtime" form:"mtime" gorm:"column:mtime" time_format:"2006-01-02 15:04:05"`
  101. }
  102. // LikesRes .
  103. type LikesRes struct {
  104. Likes map[int64]*Like `json:"likes"`
  105. PageRes
  106. }
  107. // MusicRes .
  108. type MusicRes struct {
  109. Code int `json:"code"`
  110. Data map[int64]struct {
  111. CoverURL string `json:"coverUrl"`
  112. Duration string `json:"duration"`
  113. Categorie string `json:"categorie"`
  114. Intro string `json:"intro"`
  115. Mid int64 `json:"mid"`
  116. Title string `json:"title"`
  117. SongID int64 `json:"songId"`
  118. PlayURL []string `json:"playUrl"`
  119. }
  120. }
  121. // TableName ActLikeLog def
  122. func (ActLikeLog) TableName() string {
  123. return "act_like_log"
  124. }
  125. // TableName LikeContent def
  126. func (LikeContent) TableName() string {
  127. return "like_content"
  128. }