archive_state.go 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. package archive
  2. // Const State
  3. const (
  4. // open state
  5. StateOpen = int8(0)
  6. StateOrange = int8(1)
  7. // forbit state
  8. StateForbidWait = int8(-1)
  9. StateForbidRecicle = int8(-2)
  10. StateForbidPolice = int8(-3)
  11. StateForbidLock = int8(-4)
  12. StateForbidFackLock = int8(-5)
  13. StateForbidFixed = int8(-6)
  14. StateForbidLater = int8(-7)
  15. // StateForbidPatched = int8(-8)
  16. StateForbidWaitXcode = int8(-9)
  17. StateForbidAdminDelay = int8(-10)
  18. StateForbidFixing = int8(-11)
  19. // StateForbidStorageFail = int8(-12)
  20. StateForbidOnlyComment = int8(-13)
  21. // StateForbidTmpRecicle = int8(-14)
  22. StateForbidDispatch = int8(-15)
  23. StateForbidXcodeFail = int8(-16)
  24. StateForbitUpLoad = int8(-20) // NOTE:spell body can judge to change state
  25. StateForbidSubmit = int8(-30)
  26. StateForbidUserDelay = int8(-40)
  27. StateForbidUpDelete = int8(-100)
  28. // attribute yes and no
  29. AttrYes = int32(1)
  30. AttrNo = int32(0)
  31. // attribute bit
  32. AttrBitNoRank = uint(0)
  33. AttrBitNoDynamic = uint(1)
  34. AttrBitNoWeb = uint(2)
  35. AttrBitNoMobile = uint(3)
  36. AttrBitNoSearch = uint(4)
  37. AttrBitOverseaLock = uint(5)
  38. AttrBitNoRecommend = uint(6)
  39. AttrBitNoReprint = uint(7)
  40. AttrBitHasHD5 = uint(8)
  41. AttrBitIsPGC = uint(9)
  42. AttrBitAllowBp = uint(10)
  43. AttrBitIsBangumi = uint(11)
  44. AttrBitIsPorder = uint(12)
  45. AttrBitLimitArea = uint(13)
  46. AttrBitAllowTag = uint(14)
  47. AttrBitIsFromArcAPI = uint(15) // TODO: delete
  48. AttrBitJumpURL = uint(16)
  49. AttrBitIsMovie = uint(17)
  50. AttrBitBadgepay = uint(18)
  51. AttrBitIsJapan = uint(19) //日文稿件
  52. AttrBitNoPushBplus = uint(20) //是否动态禁止
  53. AttrBitParentMode = uint(21) //家长模式
  54. AttrBitUGCPay = uint(22) //UGC付费
  55. AttrBitHasBGM = uint(23) //稿件带有BGM
  56. AttrBitSTAFF = uint(24) //联合投稿
  57. // copyright state
  58. CopyrightUnknow = int8(0)
  59. CopyrightOriginal = int8(1)
  60. CopyrightCopy = int8(2)
  61. // up_from
  62. UpFromWeb = int8(0)
  63. UpFromPGC = int8(1)
  64. UpFromWindows = int8(2)
  65. UpFromAPP = int8(3)
  66. UpFromMAC = int8(4)
  67. UpFromSecretPGC = int8(5)
  68. UpFromCoopera = int8(6)
  69. UpFromCreator = int8(7) // 创作姬
  70. // delay
  71. DelayTypeForAdmin = int8(1)
  72. DelayTypeForUser = int8(2)
  73. // flow type
  74. FlowNotLimit = int8(1)
  75. FlowBudgeting = int8(2)
  76. FlowCapping = int8(3)
  77. FlowForbid = int8(4)
  78. // flow design type
  79. FlowDesignAppFeed = int8(0)
  80. FlowDesignUp = int8(1)
  81. FlowDesignPrivate = int8(2)
  82. // oper uid
  83. AutoOperUID = int64(399)
  84. CMOperUID = int64(518)
  85. // archive list type for up
  86. UpArcAllIn = int8(0)
  87. UpArcOpenIn = int8(1)
  88. UpArcUnOpenIn = int8(2)
  89. VideoFilenameTimeout = int64(48 * 60 * 60)
  90. )
  91. var (
  92. _attr = map[int32]int32{
  93. AttrNo: AttrNo,
  94. AttrYes: AttrYes,
  95. }
  96. _copyright = map[int8]int8{
  97. CopyrightUnknow: CopyrightUnknow,
  98. CopyrightOriginal: CopyrightOriginal,
  99. CopyrightCopy: CopyrightCopy,
  100. }
  101. _bits = map[uint]string{
  102. AttrBitNoRank: "排行禁止",
  103. AttrBitNoDynamic: "动态禁止",
  104. AttrBitNoWeb: "禁止web端输出",
  105. AttrBitNoMobile: "禁止移动端输出",
  106. AttrBitNoSearch: "禁止搜索",
  107. AttrBitOverseaLock: "海外禁止",
  108. AttrBitNoRecommend: "推荐禁止",
  109. AttrBitNoReprint: "禁止转载",
  110. AttrBitHasHD5: "高清1080P",
  111. AttrBitIsPGC: "PGC稿件",
  112. AttrBitAllowBp: "允许承包",
  113. AttrBitIsBangumi: "番剧",
  114. // AttrBitAllowDownload: AttrBitAllowDownload,
  115. // AttrBitHideClick: AttrBitHideClick,
  116. AttrBitAllowTag: "允许操作TAG",
  117. // AttrBitIsFromArcApi: AttrBitIsFromArcApi,
  118. AttrBitJumpURL: "跳转",
  119. AttrBitIsMovie: "电影",
  120. AttrBitBadgepay: "付费",
  121. }
  122. // oversea forbidden typeid
  123. _overseaTypes = map[int16]int16{
  124. 32: 32, //'完结动画'
  125. 33: 33, //'连载动画'
  126. }
  127. )
  128. // InCopyrights in correct copyrights.
  129. func InCopyrights(cp int8) (ok bool) {
  130. _, ok = _copyright[cp]
  131. return
  132. }
  133. // BitDesc return bit desc.
  134. func BitDesc(bit uint) (desc string) {
  135. return _bits[bit]
  136. }
  137. // InAttr in correct attrs.
  138. func InAttr(attr int32) (ok bool) {
  139. _, ok = _attr[attr]
  140. return
  141. }
  142. // InOverseaType check in oversea forbid type.
  143. func InOverseaType(typeID int16) (ok bool) {
  144. _, ok = _overseaTypes[typeID]
  145. return
  146. }