archive.go 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. package model
  2. import (
  3. "go-common/library/time"
  4. )
  5. const (
  6. // UpFromWeb 网页上传
  7. UpFromWeb = int8(0)
  8. // UpFromPGC PGC上传
  9. UpFromPGC = int8(1)
  10. // UpFromWindows Windows客户端上传
  11. UpFromWindows = int8(2)
  12. // UpFromAPP APP上传
  13. UpFromAPP = int8(3)
  14. // UpFromMAC Mac客户端上传
  15. UpFromMAC = int8(4)
  16. // UpFromSecretPGC 机密PGC上传
  17. UpFromSecretPGC = int8(5)
  18. // UpFromCoopera 合作方嵌套
  19. UpFromCoopera = int8(6)
  20. // UpFromCreator 创作姬上传
  21. UpFromCreator = int8(7)
  22. // UpFromAndroid 安卓上传
  23. UpFromAndroid = int8(8)
  24. // UpFromIOS IOS上传
  25. UpFromIOS = int8(9)
  26. // AttrYes attribute yes
  27. AttrYes = int32(1)
  28. // AttrNo attribute no
  29. AttrNo = int32(0)
  30. // StateForbidUpDelete 用户删除
  31. StateForbidUpDelete = int8(-100)
  32. )
  33. var (
  34. _bits = map[uint]string{
  35. AttrBitNoRank: "排行禁止",
  36. AttrBitNoDynamic: "动态禁止",
  37. AttrBitNoWeb: "禁止web端输出",
  38. AttrBitNoMobile: "禁止移动端输出",
  39. AttrBitNoSearch: "禁止搜索",
  40. AttrBitOverseaLock: "海外禁止",
  41. AttrBitNoRecommend: "推荐禁止",
  42. AttrBitNoReprint: "禁止转载",
  43. AttrBitHasHD5: "高清1080P",
  44. // AttrBitVisitorDm: AttrBitVisitorDm,
  45. AttrBitIsPGC: "PGC",
  46. AttrBitAllowBp: "允许承包",
  47. AttrBitIsBangumi: "番剧",
  48. AttrBitIsPorder: "是否私单",
  49. AttrBitLimitArea: "是否地区限制",
  50. AttrBitAllowTag: "允许操作TAG",
  51. // AttrBitIsFromArcAPI: AttrBitIsFromArcAPI,
  52. AttrBitJumpURL: "跳转",
  53. AttrBitIsMovie: "电影",
  54. AttrBitBadgepay: "付费",
  55. AttrBitPushBlog: "禁止粉丝动态",
  56. }
  57. _upFromTypes = map[int8]string{
  58. UpFromWeb: "网页上传",
  59. UpFromPGC: "PGC上传",
  60. UpFromWindows: "Windows客户端上传",
  61. UpFromAPP: "APP上传",
  62. UpFromMAC: "Mac客户端上传",
  63. UpFromSecretPGC: "机密PGC上传",
  64. UpFromCoopera: "合作方嵌套",
  65. UpFromCreator: "创作姬上传",
  66. UpFromAndroid: "安卓上传",
  67. UpFromIOS: "IOS上传",
  68. }
  69. )
  70. // BitDesc return bit desc.
  71. func BitDesc(bit uint) (desc string) {
  72. return _bits[bit]
  73. }
  74. // Archive is archive model.
  75. type Archive struct {
  76. Aid int64 `json:"aid"`
  77. Mid int64 `json:"mid"`
  78. TypeID int16 `json:"tid"`
  79. HumanRank int `json:"-"`
  80. Title string `json:"title"`
  81. Author string `json:"-"`
  82. Cover string `json:"cover"`
  83. RejectReason string `json:"reject_reason"`
  84. Tag string `json:"tag"`
  85. Duration int64 `json:"duration"`
  86. Copyright int8 `json:"copyright"`
  87. Desc string `json:"desc"`
  88. MissionID int64 `json:"mission_id"`
  89. Round int8 `json:"-"`
  90. Forward int64 `json:"-"`
  91. Attribute int32 `json:"attribute"`
  92. Access int16 `json:"-"`
  93. State int8 `json:"state"`
  94. Source string `json:"source"`
  95. NoReprint int32 `json:"no_reprint"`
  96. OrderID int64 `json:"order_id"`
  97. Dynamic string `json:"dynamic"`
  98. DTime time.Time `json:"dtime"`
  99. PTime time.Time `json:"ptime"`
  100. CTime time.Time `json:"ctime"`
  101. MTime time.Time `json:"-"`
  102. }
  103. // Type is archive type info
  104. type Type struct {
  105. ID int16 `json:"id"`
  106. PID int16 `json:"pid"`
  107. Name string `json:"name"`
  108. Desc string `json:"description"`
  109. }
  110. // UpFrom get upfrom desc
  111. func UpFrom(ufID int8) string {
  112. return _upFromTypes[ufID]
  113. }