model.go 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. package model
  2. import (
  3. "encoding/json"
  4. "go-common/library/time"
  5. )
  6. //静态变量
  7. const (
  8. IsDeletedFalse = 0 //未删除标识
  9. DefaultVer = "1.0" // DefaultVer 默认初始化版本
  10. FromMain = 1 // FromMain 渠道来自主站
  11. //版本状态(1-草稿 2-待审核 3-待上架 4-已上架 -1-已下架 -2-强制下架)
  12. OnShelf = 4
  13. //Tag类型
  14. OPTag = 0 //运营标签
  15. TIDTag = 1 //一级分区标签
  16. SubTIDTag = 2 //二级分区标签
  17. NormalTag = 3 //普通标签
  18. AllowSyncOperVideoTag = int64(1)
  19. DenySyncOperVideoTag = int64(2)
  20. JobFinishNotice = 1 //运营导入脚本完成邮件推送类型
  21. VideoStCheckBack = 2 //视频状态回查
  22. VideoStPassReview = 1 //审核通过
  23. VideoStPendingPassReview = 0 //原始稿件状态,等待安全审核
  24. VideoStPassReviewReject = -1 //回查不通过
  25. VideoStCanPlay = 3 //可放出
  26. VideoStHighGrade = 4 //优质
  27. VideoStRecommend = 5 //推荐
  28. VideoStInactive = -3 //视频下架
  29. VideoStDeleted = -4 //视频硬删除
  30. //origin sync st abandon
  31. VideoRepSyncStOrigin = 0
  32. //sub bvc commit
  33. VideoRepSyncStBvcCommit = 10
  34. //receive bvc resource
  35. VideoRepSyncStInsertBvcInfo = 20
  36. //video onshelf
  37. VideoRepSyncStOnshelf = 30
  38. UVStOpAdd = 1 //add
  39. UVStOpDel = -1 //delete
  40. //StateActive 评论状态
  41. StateActive = int16(0)
  42. //DefaultType ..
  43. DefaultType = int16(23)
  44. UserTypeUp = 1
  45. //VideoFromBILI ..
  46. VideoFromBILI = 0
  47. //VideoFromBBQ ..
  48. VideoFromBBQ = 1
  49. //VideoFromCMS ..
  50. VideoFromCMS = 2
  51. //SourceRequest video_repository.sync_status source request
  52. SourceRequest = 1
  53. //SourceXcodeCover video_repository.sync_status xcode/cover
  54. SourceXcodeCover = 2
  55. //SourceAI video_repository.sync_status ai source
  56. SourceAI = 4
  57. //SourceOnshelf video_repository.sync_status video on shelf
  58. SourceOnshelf = 8
  59. VideoUploadProcessStatusFailed = -1
  60. VideoUploadProcessStatusPending = 0
  61. VideoUploadProcessStatusSuccessed = 1
  62. )
  63. //Tag .
  64. type Tag struct {
  65. ID int64 `json:"id"`
  66. Name string `json:"name"`
  67. Type int64 `json:"type"`
  68. }
  69. //VideoHiveInfo struct
  70. type VideoHiveInfo struct {
  71. AVID int64 `json:"avid"`
  72. CID int64 `json:"cid"`
  73. MID int64 `json:"mid"`
  74. Title string `json:"title"`
  75. Content string `json:"content"`
  76. Original int16 `json:"original"`
  77. Report int64 `json:"report"`
  78. DurationAll int64 `json:"duration_all"`
  79. Play int64 `json:"play"`
  80. PlayGuest int64 `json:"play_guest"`
  81. PlayFans int64 `json:"play_fans"`
  82. Access int64 `json:"access"`
  83. Reply int64 `json:"reply"`
  84. Fav int64 `json:"fav"`
  85. Likes int64 `json:"likes"`
  86. Coin int64 `json:"coin"`
  87. Share int64 `json:"share"`
  88. Danmu int64 `json:"danmu"`
  89. ElecPay int64 `json:"elec_pay"`
  90. ElecNum int64 `json:"elec_num"`
  91. ElecUser int64 `json:"elec_user"`
  92. Duration int64 `json:"duration"`
  93. State int64 `json:"state"`
  94. Tag string `json:"tag"`
  95. ShareDaily int64 `json:"share_daily"`
  96. PlayDaily int64 `json:"play_daily"`
  97. FavDaily int64 `json:"fav_daily"`
  98. ReplyDaily int64 `json:"reply_daily"`
  99. DanmuDaily int64 `json:"danmu_daily"`
  100. LikesDaily int64 `json:"likes_daily"`
  101. DurationDaily int64 `json:"duration_daily"`
  102. Pubtime string `json:"pubtime"`
  103. LogDate string `json:"log_date"`
  104. TID int64 `json:"tid"`
  105. SubTID int64 `json:"sub_tid"`
  106. Ctime string `json:"ctime"`
  107. DispatchStatus int64 `json:"dispatch_status"`
  108. IsFullScreen int16 `json:"is_full_screen"`
  109. }
  110. // VideoInfo 一般视频信息
  111. type VideoInfo struct {
  112. SVID int64 `json:"svid"`
  113. TID int64 `json:"tid"`
  114. SubTID int64 `json:"sub_tid"`
  115. Title string `json:"title"`
  116. Content string `json:"content"`
  117. MID int64 `json:"mid"`
  118. Report int64 `json:"report"`
  119. Duration int64 `json:"duration"`
  120. Pubtime string `json:"pubtime"`
  121. Ctime time.Time `json:"ctime"`
  122. AVID int64 `json:"avid"`
  123. CID int64 `json:"cid"`
  124. State int16 `json:"state"`
  125. Original int16 `json:"original"`
  126. From int16 `json:"from"`
  127. VerID int64 `json:"ver_id"`
  128. Ver int64 `json:"ver"`
  129. }
  130. // VideoStHive 视频hive统计数据
  131. type VideoStHive struct {
  132. SVID int64 `json:"svid"`
  133. Play int64 `json:"play"`
  134. Report int64 `json:"report"`
  135. DurationAll int64 `json:"duration_all"`
  136. Access int64 `json:"access"`
  137. Reply int64 `json:"reply"`
  138. Fav int64 `json:"fav"`
  139. Likes int64 `json:"likes"`
  140. Coin int64 `json:"coin"`
  141. Share int64 `json:"share"`
  142. Subtitles int64 `json:"subtitles"`
  143. ElecPay int64 `json:"elec_pay"`
  144. ElecNum int64 `json:"elec_num"`
  145. ElecUser int64 `json:"elec_user"`
  146. DurationDaily int64 `json:"duration_daily"`
  147. ShareDaily int64 `json:"share_daily"`
  148. PlayDaily int64 `json:"play_daily"`
  149. FavDaily int64 `json:"fav_daily"`
  150. ReplyDaily int64 `json:"reply_daily"`
  151. SubtitlesDaily int64 `json:"subtitles_daily"`
  152. LikesDaily int64 `json:"likes_daily"`
  153. }
  154. // UserBaseDB 用户基础表字段
  155. type UserBaseDB struct {
  156. ID int64 `json:"id"`
  157. MID int64 `json:"mid"`
  158. Uname string `json:"uname"`
  159. Face string `json:"face"`
  160. Birthday string `json:"birthday"`
  161. Exp int64 `json:"exp"`
  162. Level int64 `json:"level"`
  163. Ctime time.Time `json:"ctime"`
  164. Mtime time.Time `json:"mtime"`
  165. Signature string `json:"signature"`
  166. Region int64 `json:"region"`
  167. Sex int16 `json:"sex"`
  168. }
  169. //UserDmg 用户画像
  170. type UserDmg struct {
  171. MID string `json:"mid"`
  172. Gender string `json:"gender"`
  173. Age string `json:"age"`
  174. Geo string `json:"geo"`
  175. ContentTag string `json:"content_tag"`
  176. ViewedVideo map[int64]string `json:"viewed_video"`
  177. ContentZone string `json:"content_zone"`
  178. ContentCount string `json:"content_count"`
  179. FollowUps string `json:"follow_ups"`
  180. }
  181. //UserBbqDmg 用户画像
  182. type UserBbqDmg struct {
  183. MID string `json:"mid"`
  184. Tag2 []string `json:"tag2"`
  185. Tag3 []string `json:"tag3"`
  186. Up []string `json:"up"`
  187. }
  188. //UserBbqBuvidDmg 用户画像buvid
  189. type UserBbqBuvidDmg struct {
  190. Buvid string `json:"mid"`
  191. Tag2 []string `json:"tag2"`
  192. Tag3 []string `json:"tag3"`
  193. Up []string `json:"up"`
  194. }
  195. //UpUserDmg 主站up主用户画像
  196. type UpUserDmg struct {
  197. MID int64 `json:"mid"`
  198. Uname string `json:"uname"`
  199. Play int64 `json:"play"`
  200. Fans int64 `json:"fans"`
  201. AVs int64 `json:"avs"`
  202. Likes int64 `json:"likes"`
  203. }
  204. // CheckTask .
  205. type CheckTask struct {
  206. TaskID int64 `json:"task_id"`
  207. TaskName string `json:"task_name"`
  208. LastCheck int64 `json:"last_check"`
  209. }
  210. // DatabusRes canal standary message
  211. type DatabusRes struct {
  212. Action string `json:"action"`
  213. Table string `json:"table"`
  214. New json.RawMessage `json:"new"`
  215. Old json.RawMessage `json:"old"`
  216. }
  217. //DatabusBVCTransSub ...
  218. type DatabusBVCTransSub struct {
  219. SVID int64 `json:"svid"`
  220. }
  221. // VideoDB 视频表数据库字段
  222. type VideoDB struct {
  223. AutoID int64 `json:"auto_id"`
  224. ID int64 `json:"id"`
  225. Title string `json:"title"`
  226. Content string `json:"content"`
  227. MID int64 `json:"mid"`
  228. CID int64 `json:"cid"`
  229. Pubtime time.Time `json:"pubtime"`
  230. Ctime string `json:"ctime"`
  231. Duration int64 `json:"duration"`
  232. Original int16 `json:"original"`
  233. State int16 `json:"state"`
  234. IsFull int16 `json:"is_full_screen"`
  235. VerID int64 `json:"ver_id"`
  236. Ver string `json:"ver"`
  237. From int16 `json:"from"`
  238. AVID int64 `json:"avid"`
  239. TID int64 `json:"tid"`
  240. SubTID int64 `json:"sub_tid"`
  241. Score int64 `json:"score"`
  242. CoverURL string `json:"cover_url"`
  243. CoverWidth int64 `json:"cover_width"`
  244. CoverHeight int64 `json:"cover_height"`
  245. }
  246. // VideoRaw 视频原生表数据库字段
  247. type VideoRaw struct {
  248. ID int64 `json:"id"`
  249. Title string `json:"title"`
  250. Content string `json:"content"`
  251. MID int64 `json:"mid"`
  252. CID int64 `json:"cid"`
  253. Pubtime string `json:"pubtime"`
  254. Ctime string `json:"ctime"`
  255. Duration int64 `json:"duration"`
  256. Original int16 `json:"original"`
  257. State int16 `json:"state"`
  258. IsFull int16 `json:"is_full_screen"`
  259. VerID int64 `json:"ver_id"`
  260. Ver string `json:"ver"`
  261. From int16 `json:"from"`
  262. AVID int64 `json:"avid"`
  263. TID int64 `json:"tid"`
  264. SubTID int64 `json:"sub_tid"`
  265. Score int64 `json:"score"`
  266. CoverURL string `json:"cover_url"`
  267. CoverWidth int64 `json:"cover_width"`
  268. CoverHeight int64 `json:"cover_height"`
  269. SVID int64 `json:"svid"`
  270. }
  271. // VideoRepRaw 视频原生表数据库字段
  272. type VideoRepRaw struct {
  273. ID int64 `json:"id"`
  274. SVID int64 `json:"svid"`
  275. Title string `json:"title"`
  276. Content string `json:"content"`
  277. MID int64 `json:"mid"`
  278. CID int64 `json:"cid"`
  279. Pubtime string `json:"pubtime"`
  280. Duration int64 `json:"duration"`
  281. Original int16 `json:"original"`
  282. IsFull int16 `json:"is_full_screen"`
  283. From int16 `json:"from"`
  284. AVID int64 `json:"avid"`
  285. TID int64 `json:"tid"`
  286. SubTID int64 `json:"sub_tid"`
  287. Score int64 `json:"score"`
  288. CoverURL string `json:"cover_url"`
  289. CoverWidth int64 `json:"cover_width"`
  290. CoverHeight int64 `json:"cover_height"`
  291. Tag string `json:"tag"`
  292. SyncStatus int64 `json:"sync_status"`
  293. HomeImgURL string `json:"home_img_url" form:"home_img_url"`
  294. HomeImgWidth int64 `json:"home_img_width" form:"home_img_width"`
  295. HomeImgHeight int64 `json:"home_img_height" form:"home_img_height"`
  296. }
  297. //UpUserInfoRes account服务返回信息
  298. type UpUserInfoRes struct {
  299. MID int64 `json:"mid"`
  300. Name string `json:"name"`
  301. Sex string `json:"sex"`
  302. Face string `json:"face"`
  303. Sign string `json:"sign"`
  304. Rank int64 `json:"rank"`
  305. }
  306. // UserBase .
  307. type UserBase struct {
  308. Mid int64 `json:"mid"`
  309. Uname string `json:"uname"`
  310. Face string `json:"face"`
  311. }
  312. //CmsVideo ..
  313. type CmsVideo struct {
  314. ID int64 `json:"id"`
  315. SVStatus int64 `json:"sv_status"`
  316. Pubtime string `json:"pubtime"`
  317. Mid int64 `json:"mid"`
  318. Title string `json:"title"`
  319. From int64 `json:"from"`
  320. }