subject.go 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. package model
  2. import (
  3. xtime "go-common/library/time"
  4. )
  5. // VIDEO actiivty types .
  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. )
  26. // SidSub def
  27. type SidSub struct {
  28. Type int `form:"type" validate:"required"`
  29. Lids []int64 `form:"lids,split" validate:"max=50,min=1,dive,min=1"`
  30. }
  31. // ListSub def
  32. type ListSub struct {
  33. Page int `form:"page" default:"1" validate:"min=1"`
  34. PageSize int `form:"pagesize" default:"15" validate:"min=1"`
  35. Keyword string `form:"keyword"`
  36. States []int `form:"state,split" default:"0"`
  37. Types []int `form:"type,split" default:"0"`
  38. Sctime int64 `form:"sctime"`
  39. Ectime int64 `form:"ectime"`
  40. }
  41. // SubListRes .
  42. type SubListRes struct {
  43. List []*ActSubject `json:"list"`
  44. Page *PageRes `json:"page"`
  45. }
  46. // PageRes .
  47. type PageRes struct {
  48. Num int `json:"num"`
  49. Size int `json:"size"`
  50. Total int64 `json:"total"`
  51. }
  52. // AddList def
  53. type AddList struct {
  54. ActSubject
  55. Protocol string `form:"protocol"`
  56. Types string `form:"types"`
  57. Pubtime xtime.Time `form:"pubtime" time_format:"2006-01-02 15:04:05"`
  58. Deltime xtime.Time `form:"deltime" time_format:"2006-01-02 15:04:05"`
  59. Editime xtime.Time `form:"editime" time_format:"2006-01-02 15:04:05"`
  60. Tags string `form:"tags"`
  61. Interval int `form:"interval"`
  62. Tlimit int `form:"tlimit"`
  63. Ltime int `form:"ltime"`
  64. Hot int `form:"hot"`
  65. BgmID int64 `form:"bgm_id"`
  66. PasterID int64 `form:"paster_id"`
  67. Oids string `from:"oids"`
  68. ScreenSet int `form:"screen_set" default:"1"`
  69. }
  70. //ActSubjectProtocol def
  71. type ActSubjectProtocol struct {
  72. ID int64 `json:"id" form:"id" gorm:"column:id"`
  73. Sid int64 `json:"sid" form:"sid"`
  74. Protocol string `json:"protocol" form:"protocol"`
  75. Mtime xtime.Time `json:"mtime" form:"mtime" time_format:"2006-01-02 15:04:05"`
  76. Ctime xtime.Time `json:"ctime" form:"ctime" time_format:"2006-01-02 15:04:05"`
  77. Types string `json:"types" form:"types"`
  78. Tags string `json:"tags" form:"tags"`
  79. Hot int `json:"hot" form:"hot"`
  80. Pubtime xtime.Time `json:"pubtime" form:"pubtime" time_format:"2006-01-02 15:04:05"`
  81. Deltime xtime.Time `json:"deltime" form:"deltime" time_format:"2006-01-02 15:04:05"`
  82. Editime xtime.Time `json:"editime" form:"editime" time_format:"2006-01-02 15:04:05"`
  83. BgmID int64 `json:"bgm_id" form:"bgm_id" gorm:"column:bgm_id"`
  84. PasterID int64 `json:"paster_id" form:"paster_id" gorm:"column:paster_id"`
  85. Oids string `json:"oids" form:"oids" gorm:"column:oids"`
  86. ScreenSet int `json:"screen_set" form:"screen_set" gorm:"column:screen_set"`
  87. }
  88. //ActTimeConfig def
  89. type ActTimeConfig struct {
  90. ID int64 `json:"id" form:"id" gorm:"column:id"`
  91. Sid int64 `json:"sid" form:"sid"`
  92. Interval int `json:"interval" form:"interval"`
  93. Ctime xtime.Time `json:"ctime" form:"ctime" time_format:"2006-01-02 15:04:05"`
  94. Mtime xtime.Time `json:"mtime" form:"mtime" time_format:"2006-01-02 15:04:05"`
  95. Tlimit int `json:"tlimit" form:"tlimit"`
  96. Ltime int `json:"ltime" form:"ltime"`
  97. }
  98. // ActSubject def.
  99. type ActSubject struct {
  100. ID int64 `json:"id,omitempty" form:"id" gorm:"column:id"`
  101. Oid int64 `json:"oid,omitempty" form:"oid"`
  102. Type int `json:"type,omitempty" form:"type"`
  103. State int `json:"state,omitempty" form:"state"`
  104. Level int `json:"level,omitempty" form:"level"`
  105. Flag int64 `json:"flag,omitempty" form:"flag"`
  106. Rank int64 `json:"rank,omitempty" form:"rank"`
  107. Stime xtime.Time `json:"stime,omitempty" form:"stime" time_format:"2006-01-02 15:04:05"`
  108. Etime xtime.Time `json:"etime,omitempty" form:"etime" time_format:"2006-01-02 15:04:05"`
  109. Ctime xtime.Time `json:"ctime,omitempty" form:"ctime" time_format:"2006-01-02 15:04:05"`
  110. Mtime xtime.Time `json:"mtime,omitempty" form:"mtime" time_format:"2006-01-02 15:04:05"`
  111. Lstime xtime.Time `json:"lstime,omitempty" form:"lstime" time_format:"2006-01-02 15:04:05"`
  112. Letime xtime.Time `json:"letime,omitempty" form:"letime" time_format:"2006-01-02 15:04:05"`
  113. Uetime xtime.Time `json:"uetime,omitempty" form:"uetime" time_format:"2006-01-02 15:04:05"`
  114. Ustime xtime.Time `json:"ustime,omitempty" form:"ustime" time_format:"2006-01-02 15:04:05"`
  115. Name string `json:"name,omitempty" form:"name"`
  116. Author string `json:"author,omitempty" form:"author"`
  117. ActURL string `json:"act_url,omitempty" form:"act_url"`
  118. Cover string `json:"cover,omitempty" form:"cover"`
  119. Dic string `json:"dic,omitempty" form:"dic"`
  120. H5Cover string `json:"h5_cover,omitempty" form:"h5_cover"`
  121. LikeLimit int `json:"like_limit" form:"like_limit"`
  122. AndroidURL string `json:"android_url"`
  123. IosURL string `json:"ios_url"`
  124. }
  125. // ActSubjectResult .
  126. type ActSubjectResult struct {
  127. *ActSubject
  128. Aids []int64 `json:"aids,omitempty"`
  129. }
  130. // Like def.
  131. type Like struct {
  132. ID int64 `json:"id" form:"id" gorm:"column:id"`
  133. Sid int64 `json:"sid" form:"sid"`
  134. Type int `json:"type" form:"type"`
  135. Mid int64 `json:"mid" form:"mid"`
  136. Wid int64 `json:"wid" form:"wid"`
  137. State int `json:"state" form:"state"`
  138. StickTop int `json:"stick_top" form:"stick_top"`
  139. Ctime xtime.Time `json:"ctime" form:"ctime" time_format:"2006-01-02 15:04:05"`
  140. Mtime xtime.Time `json:"mtime" form:"mtime" time_format:"2006-01-02 15:04:05"`
  141. Object interface{} `json:"object,omiempty" gorm:"-"`
  142. Like int64 `json:"like,omiempty" gorm:"-"`
  143. }
  144. //LikeAction def
  145. type LikeAction struct {
  146. ID int64 `form:"id" gorm:"column:id"`
  147. Lid int64 `form:"lid"`
  148. Mid int64 `form:"mid"`
  149. Action int64 `form:"action"`
  150. Ctime xtime.Time `form:"ctime" time_format:"2006-01-02 15:04:05"`
  151. Mtime xtime.Time `form:"mtime" time_format:"2006-01-02 15:04:05"`
  152. Sid int64 `form:"sid"`
  153. IP int64 `form:"ip" gorm:"column:ip"`
  154. }
  155. // TableName LikeAction def
  156. func (LikeAction) TableName() string {
  157. return "like_action"
  158. }
  159. // TableName ActMatchs def.
  160. func (ActSubject) TableName() string {
  161. return "act_subject"
  162. }
  163. // TableName Likes def
  164. func (Like) TableName() string {
  165. return "likes"
  166. }
  167. // TableName ActSubjectProtocol def
  168. func (ActSubjectProtocol) TableName() string {
  169. return "act_subject_protocol"
  170. }
  171. // TableName ActTimeConfig def
  172. func (ActTimeConfig) TableName() string {
  173. return "act_time_config"
  174. }