water_mark.go 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. package model
  2. import "go-common/library/time"
  3. const (
  4. //WatermarkWhite 水印白名单
  5. WatermarkWhite = 1
  6. //WatermarkDefault 水印默认值
  7. WatermarkDefault = 0
  8. //OrderDesc 降序
  9. OrderDesc = 1
  10. )
  11. // WaterMarkList def.
  12. type WaterMarkList struct {
  13. ID string `form:"id" json:"id"`
  14. Epid string `form:"epid" json:"epid"`
  15. SeasonID string `form:"season_id" json:"season_id"`
  16. Category string `form:"category" json:"category"`
  17. SeasonTitle string `form:"season_title" json:"season_title"`
  18. ContentTitle string `form:"content_title" json:"content_title"`
  19. MarkTime time.Time `form:"mark_time" json:"mark_time"`
  20. }
  21. // WaterMarkOne is used for only selecting some field from gorm query
  22. type WaterMarkOne struct {
  23. ID string `form:"id" json:"id"`
  24. Mark uint8 `form:"mark" json:"mark"`
  25. MarkTime string `form:"mark_time" json:"mark_time"`
  26. }
  27. // WaterMarkListPager is used for return items and pager info
  28. type WaterMarkListPager struct {
  29. Items []*WaterMarkList `json:"items"`
  30. Page *Page `json:"page"`
  31. }
  32. // WaterMarkListParam is use for watermarklist function query param valid
  33. type WaterMarkListParam struct {
  34. Order uint8 `form:"id" json:"order" default:"1"`
  35. EpID string `form:"epid" json:"epid"`
  36. SeasonID string `form:"season_id" json:"season_id"`
  37. Category string `form:"category" json:"category"`
  38. Pn int `form:"pn" json:"pn;Min(1)" default:"1"`
  39. Ps int `form:"ps" json:"ps;Min(1)" default:"20"`
  40. }
  41. // TransReq is the request for transcode consulting
  42. type TransReq struct {
  43. Order int `form:"order" default:"1"` // 1=desc,2=asc
  44. EpID int64 `form:"epid"`
  45. SeasonID int64 `form:"season_id"`
  46. Title string `form:"title"`
  47. Category int `form:"category" validate:"min=0,max=5"`
  48. Status string `form:"status"`
  49. Pn int `form:"pn" default:"1"`
  50. }
  51. // TransReply is the response for transList
  52. type TransReply struct {
  53. EpID int64 `json:"epid"`
  54. SeasonID int64 `json:"season_id"`
  55. Category string `json:"category"`
  56. Etitle string `json:"etitle"`
  57. Stitle string `json:"stitle"`
  58. Transcoded int `json:"transcoded"`
  59. ApplyTime string `json:"apply_time"`
  60. MarkTime string `json:"mark_time"`
  61. }
  62. // TransPager is used for return items and pager info
  63. type TransPager struct {
  64. Items []*TransReply `json:"items"`
  65. Page *Page `json:"page"`
  66. CountSn int `json:"count_sn"`
  67. }
  68. // AddEpIDResp is for function addEpID to return success and not exist and invalid values
  69. type AddEpIDResp struct {
  70. Succ []int64
  71. NotExist []int64
  72. Invalids []int64
  73. }
  74. // TableName select watermark list
  75. func (a WaterMarkList) TableName() string {
  76. return "tv_content"
  77. }
  78. //TableName only select watermark one
  79. func (a WaterMarkOne) TableName() string {
  80. return "tv_content"
  81. }