full.go 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. package model
  2. import (
  3. "go-common/library/time"
  4. )
  5. // APKInfo .
  6. type APKInfo struct {
  7. ID int64 `json:"id"`
  8. CDNAddr string `json:"cdn_addr"`
  9. CreatedAt time.Time `json:"created_at"`
  10. FileMd5 string `json:"file_md5"`
  11. InetAddr string `json:"inet_addr"`
  12. IsDeleted bool `json:"is_deleted"`
  13. IsGray bool `json:"is_gray"`
  14. LocalPath string `json:"local_path"`
  15. MappingAddr string `json:"mapping_addr"`
  16. SignMd5 string `json:"sign_md5"`
  17. Size int `json:"size"`
  18. UpdatedAt time.Time `json:"updated_at"`
  19. VersionCode int `json:"version_code"`
  20. VersionID string `json:"version_id"`
  21. VersionName string `json:"version_name"`
  22. }
  23. // MangoRecom is mango recom table structure
  24. type MangoRecom struct {
  25. ID int64 `json:"id" gorm:"column:id"`
  26. RID int64 `json:"rid" gorm:"column:rid"`
  27. Rtype int `json:"rtype"`
  28. Title string `json:"title"`
  29. Cover string `json:"cover"`
  30. Category int `json:"category"`
  31. Playcount int64 `json:"playcount"`
  32. JID int64 `json:"jid" gorm:"column:jid"`
  33. Content string `json:"content"`
  34. Staff string `json:"staff"`
  35. Rorder int `json:"rorder"`
  36. }
  37. // MangoListResp is the mango list response structure
  38. type MangoListResp struct {
  39. List []*MangoRecom `json:"list"`
  40. Pubtime string `json:"pubtime"`
  41. Message string `json:"message"` // 文案提示: rid, p213,u367 ...
  42. }
  43. // MangoAdd is the response of mango add function
  44. type MangoAdd struct {
  45. Succ []int64 `json:"succ"`
  46. Invalids []int64 `json:"invalids"`
  47. }
  48. // TableName def.
  49. func (*MangoRecom) TableName() string {
  50. return "mango_recom"
  51. }
  52. // ToMango def.
  53. func (sn *TVEpSeason) ToMango() *MangoRecom {
  54. return &MangoRecom{
  55. RID: sn.ID,
  56. Rtype: 1,
  57. Title: sn.Title,
  58. Cover: sn.Cover,
  59. Category: int(sn.Category),
  60. Content: sn.Desc,
  61. Staff: sn.Staff,
  62. }
  63. }
  64. // ToMango def.
  65. func (arc *SimpleArc) ToMango(cat int) *MangoRecom {
  66. return &MangoRecom{
  67. RID: arc.AID,
  68. Rtype: 2,
  69. Title: arc.Title,
  70. Cover: arc.Cover,
  71. Category: cat,
  72. Content: arc.Content,
  73. }
  74. }
  75. // ReqMangoEdit is the request for mango edit
  76. type ReqMangoEdit struct {
  77. ID int64 `form:"id" validate:"required"`
  78. Title string `form:"title" validate:"required"`
  79. Cover string `form:"cover" validate:"required"`
  80. Playcount int64 `form:"playcount"`
  81. JID int64 `form:"jid"`
  82. Content string `form:"content" validate:"required"`
  83. Staff string `form:"staff"`
  84. }
  85. // MRecomMC is mango recom struct in MC
  86. type MRecomMC struct {
  87. RIDs []int64
  88. Pubtime time.Time
  89. }
  90. // ReqUnshelve is request for unshelve
  91. type ReqUnshelve struct {
  92. IDs []int64 `form:"ids,split" validate:"required,min=1,dive,gt=0"`
  93. Type int `form:"type" validate:"required,min=1,max=4"`
  94. }
  95. // RespUnshelve is response for unshelve
  96. type RespUnshelve struct {
  97. SuccIDs []int64 `json:"succ_ids"`
  98. FailIDs []int64 `json:"fail_ids"`
  99. }