credit_state.go 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. package model
  2. import (
  3. "fmt"
  4. )
  5. // blocked const
  6. const (
  7. // item type
  8. BUSSINESS = "credit-job"
  9. // deal bussinss time type
  10. DealTimeTypeNone = int8(0)
  11. DealTimeTypeDay = int8(1)
  12. DealTimeTypeYear = int8(2)
  13. // default time
  14. DefaultTime = "1979-12-31 16:00:00"
  15. TimeFormatSec = "2006-01-02 15:04:05"
  16. // Case Status
  17. CaseStatusGranting = 1 // 发放中
  18. CaseStatusGrantStop = 2 // 停止发放
  19. CaseStatusDealing = 3 // 结案中
  20. CaseStatusDealed = 4 // 已裁决
  21. CaseStatusRestart = 5 // 待重启
  22. CaseStatusUndealed = 6 // 未裁决
  23. CaseStatusFreeze = 7 // 冻结中
  24. CaseStatusQueueing = 8 // 队列中
  25. // Judge Status.
  26. JudgeTypeUndeal = 0 // 未裁决
  27. JudgeTypeViolate = 1 // 违规
  28. JudgeTypeLegal = 2 // 未违规
  29. // Vote Status.
  30. VoteTypeUndo = 0 // 未投票
  31. VoteTypeViolate = 1 // 违规-封禁
  32. VoteTypeDelete = 4 // 违规-删除
  33. VoteTypeLegal = 2 // 不违规
  34. VoteTypeGiveUp = 3 // 放弃投票
  35. // punish type.
  36. PunishTypeMoral = int8(1)
  37. PunishTypeBlock = int8(2)
  38. PunishTypeForever = int8(3)
  39. // blocked_info blocked_forever
  40. NotInBlockedForever = int8(0)
  41. InBlockedForever = int8(1)
  42. // Block Time.
  43. Punish3Days = 1
  44. Punish7Days = 2
  45. PunishForever = 3
  46. PunishCustom = 4
  47. Punish15Days = 5
  48. PunishBlock = 0
  49. PunishJury = 1
  50. // origin_type.
  51. OriginReply = int8(1) // 评论
  52. OriginDM = int8(2) // 弹幕
  53. OriginMsg = int8(3) // 私信
  54. OriginTag = int8(4) // 标签
  55. OriginMember = int8(5) // 个人资料
  56. OriginArchive = int8(6) // 投稿
  57. OriginMusic = int8(7) // 音频
  58. OriginArticle = int8(8) // 专栏
  59. OriginSpaceTop = int8(9) // 空间头图
  60. OriginDsynamic = int8(10) // 动态
  61. OriginPhoto = int8(11) // 相册
  62. OriginMinVideo = int8(12) // 小视频
  63. // Jury Invalid
  64. JuryBlocked = 1
  65. JuryExpire = 2
  66. JuryAdmin = 3
  67. // Case Load Switch
  68. StateCaseLoadClose = int8(0)
  69. StateCaseLoadOpen = int8(1)
  70. // Blocked Opinio State
  71. OpinionStateOpen = int8(0)
  72. OpinionStateClose = int8(1)
  73. OpinionStateCloseAndMsg = int8(2)
  74. // blocked_jury.case_type
  75. JudeCaseTypePrivate = int8(0) // 小众众裁
  76. JudeCaseTypePublic = int8(1) // 大众众裁
  77. // Reply regist type.
  78. ReplyBlocked = int8(6)
  79. ReplyPublish = int8(7)
  80. ReplyCase = int8(15)
  81. // blocked_publish.publish_status
  82. PublishClose = int8(0)
  83. PublishOpen = int8(1)
  84. // status
  85. StatusClose = int8(1)
  86. StatusOpen = int8(0)
  87. // blocked_case.punish_result
  88. BlockNone = int8(0)
  89. Block3Days = int8(1)
  90. Block7Days = int8(2)
  91. BlockForever = int8(3)
  92. BlockCustom = int8(4)
  93. Block15Days = int8(5)
  94. BlockOnlyDel = int8(6)
  95. // block time
  96. BlockTimeForever = 0 // 永久封禁
  97. BlockTimeThree = 3 // 3天封禁
  98. BlockTimeSeven = 7 // 7天封禁
  99. BlockTimeFifteen = 15 // 15天封禁
  100. // reasonType
  101. ReasonOtherType = int8(0)
  102. ReasonBrushScreen = int8(1)
  103. ReasonGrabFloor = int8(2)
  104. ReasonGamblingFraud = int8(4)
  105. ReasonProhibited = int8(5)
  106. ReasonGarbageAds = int8(6)
  107. ReasonPersonalAttacks = int8(7)
  108. ReasonViolatePrivacy = int8(8)
  109. ReasonLeadBattle = int8(9)
  110. ReasonSpoiler = int8(10)
  111. ReasonAddUnrelatedTags = int8(11)
  112. ReasonDelOtherTags = int8(12)
  113. ReasonPornographic = int8(13)
  114. ReasonVulgar = int8(14)
  115. ReasonBloodyViolence = int8(15)
  116. ReasonAnimusVideoUp = int8(16)
  117. ReasonIllegalWebsite = int8(17)
  118. ReasonSpreadErrinfo = int8(18)
  119. ReasonAbettingEncouragement = int8(19)
  120. ReasonAnimusBrushScreen = int8(20)
  121. ReasonAccountViolation = int8(21)
  122. ReasonMaliciousPlagiarism = int8(22)
  123. ReasonPosingAsHomemade = int8(23)
  124. ReasonPostTeenBadContent = int8(24)
  125. ReasonDestroyCyberSecurity = int8(25)
  126. ReasonPostingMisleadingInfo = int8(26)
  127. ReasonCounterfeitOfficialAuth = int8(27)
  128. ReasonPublishInappropriateContent = int8(28)
  129. ReasonViolationOperatingRules = int8(29)
  130. ReasonIllegalCreateTopic = int8(30)
  131. ReasonIllegalDrawLottery = int8(31)
  132. ReasonIllegalFakeMan = int8(32)
  133. // reply reasonType
  134. ReplyReasonOtherType = int8(0)
  135. ReplyReasonGarbageAds = int8(1)
  136. ReplyReasonPornographic = int8(2)
  137. ReplyReasonAnimusBrushScreen = int8(3)
  138. ReplyReasonLeadBattle = int8(4)
  139. ReplyReasonSpoiler = int8(5)
  140. ReplyReasonPolitical = int8(6)
  141. ReplyReasonPersonalAttacks = int8(7)
  142. ReplyReasonIrrelevantVideo = int8(8)
  143. ReplyReasonProhibited = int8(9)
  144. ReplyReasonVulgar = int8(10)
  145. ReplyReasonIllegalWebsite = int8(11)
  146. ReplyReasonGamblingFraud = int8(12)
  147. ReplyReasonSpreadErrinfo = int8(13)
  148. ReplyReasonAbettingEncouragement = int8(14)
  149. ReplyReasonViolatePrivacy = int8(15)
  150. ReplyReasonGrabFloor = int8(16)
  151. ReplyReasonPostTeenBadContent = int8(17)
  152. // tag reasonType
  153. TagReasonAddUnrelatedTags = int8(1)
  154. TagReasonProhibited = int8(2)
  155. TagReasonPersonalAttacks = int8(3)
  156. TagReasonSpoiler = int8(4)
  157. TagReasonDelOtherTags = int8(5)
  158. // moral originType
  159. MoralOriginDM = int8(1)
  160. MoralOriginReply = int8(2)
  161. MoralOriginTag = int8(3)
  162. // block status
  163. BlockStatusNone = int8(0)
  164. BlockStatusForever = int8(1)
  165. BlockStatusOn = int8(2)
  166. // defealt deduct moral val
  167. DefealtMoralVal = -10
  168. // dm notify status
  169. DMNotifyNotDel = 0
  170. DMNotifyDel = 1
  171. // msg content
  172. _dealMsgTitle = "%s违规处理通知"
  173. _dealMsgContent = `您好,根据用户举报与风纪委众裁,您在#{"%s"}{%s}下的%s 『%s』,已被移除。请自觉遵守国家相关法律法规及《社区规则》,bilibili良好的社区氛围需要大家一起维护!
  174. 其中,《社区规则》为可点击超链接,地址:https://www.bilibili.com/blackboard/blackroom.html`
  175. // moral remark
  176. MoralRemark = "违规惩罚"
  177. )
  178. var (
  179. _punishType = map[int8]string{
  180. PunishTypeMoral: "节操",
  181. PunishTypeBlock: "封禁",
  182. PunishTypeForever: "永久封禁",
  183. }
  184. _reasonType = map[int8]string{
  185. ReasonOtherType: "其他",
  186. ReasonBrushScreen: "刷屏",
  187. ReasonGrabFloor: "抢楼",
  188. ReasonGamblingFraud: "发布赌博诈骗信息",
  189. ReasonProhibited: "发布违禁相关信息",
  190. ReasonGarbageAds: "发布垃圾广告信息",
  191. ReasonPersonalAttacks: "发布人身攻击言论",
  192. ReasonViolatePrivacy: "发布侵犯他人隐私信息",
  193. ReasonLeadBattle: "发布引战言论",
  194. ReasonSpoiler: "发布剧透信息",
  195. ReasonAddUnrelatedTags: "恶意添加无关标签",
  196. ReasonDelOtherTags: "恶意删除他人标签",
  197. ReasonPornographic: "发布色情信息",
  198. ReasonVulgar: "发布低俗信息",
  199. ReasonBloodyViolence: "发布暴力血腥信息",
  200. ReasonAnimusVideoUp: "涉及恶意投稿行为",
  201. ReasonIllegalWebsite: "发布非法网站信息",
  202. ReasonSpreadErrinfo: "发布传播不实信息",
  203. ReasonAbettingEncouragement: "发布怂恿教唆信息",
  204. ReasonAnimusBrushScreen: "恶意刷屏",
  205. ReasonAccountViolation: "账号违规",
  206. ReasonMaliciousPlagiarism: "恶意抄袭",
  207. ReasonPosingAsHomemade: "冒充自制原创",
  208. ReasonPostTeenBadContent: "发布青少年不良内容",
  209. ReasonDestroyCyberSecurity: "破坏网络安全",
  210. ReasonPostingMisleadingInfo: "发布虚假误导信息",
  211. ReasonCounterfeitOfficialAuth: "仿冒官方认证账号",
  212. ReasonPublishInappropriateContent: "发布不适宜内容",
  213. ReasonViolationOperatingRules: "违反运营规则",
  214. ReasonIllegalCreateTopic: "恶意创建话题",
  215. ReasonIllegalDrawLottery: "发布违规抽奖",
  216. ReasonIllegalFakeMan: "恶意冒充他人",
  217. }
  218. _originType = map[int8]string{
  219. OriginReply: "评论",
  220. OriginDM: "弹幕",
  221. OriginMsg: "私信",
  222. OriginTag: "标签",
  223. OriginMember: "个人资料",
  224. OriginArchive: "投稿",
  225. OriginMusic: "音频",
  226. OriginArticle: "专栏",
  227. OriginSpaceTop: "空间头图",
  228. OriginDsynamic: "动态",
  229. OriginPhoto: "相册",
  230. OriginMinVideo: "小视频",
  231. }
  232. _reasonToFreeze = map[int8]bool{
  233. ReasonGamblingFraud: true,
  234. ReasonViolatePrivacy: true,
  235. ReasonProhibited: true,
  236. ReasonPornographic: true,
  237. ReasonVulgar: true,
  238. ReasonSpoiler: false,
  239. ReasonGrabFloor: false,
  240. ReasonGarbageAds: false,
  241. ReasonLeadBattle: false,
  242. ReasonBrushScreen: false,
  243. ReasonPersonalAttacks: false,
  244. }
  245. _replyReasonType = map[int8]int8{
  246. ReplyReasonOtherType: ReasonOtherType,
  247. ReplyReasonGarbageAds: ReasonGarbageAds,
  248. ReplyReasonPornographic: ReasonPornographic,
  249. ReplyReasonAnimusBrushScreen: ReasonAnimusBrushScreen,
  250. ReplyReasonLeadBattle: ReasonLeadBattle,
  251. ReplyReasonSpoiler: ReasonSpoiler,
  252. ReplyReasonPolitical: ReasonOtherType,
  253. ReplyReasonPersonalAttacks: ReasonPersonalAttacks,
  254. ReplyReasonIrrelevantVideo: ReasonOtherType,
  255. ReplyReasonProhibited: ReasonProhibited,
  256. ReplyReasonVulgar: ReasonVulgar,
  257. ReplyReasonIllegalWebsite: ReasonIllegalWebsite,
  258. ReplyReasonGamblingFraud: ReasonGamblingFraud,
  259. ReplyReasonSpreadErrinfo: ReasonSpreadErrinfo,
  260. ReplyReasonAbettingEncouragement: ReasonAbettingEncouragement,
  261. ReplyReasonViolatePrivacy: ReasonViolatePrivacy,
  262. ReplyReasonGrabFloor: ReasonGrabFloor,
  263. ReplyReasonPostTeenBadContent: ReasonPostTeenBadContent,
  264. }
  265. _tagReasonType = map[int8]int8{
  266. TagReasonAddUnrelatedTags: ReasonAddUnrelatedTags,
  267. TagReasonProhibited: ReasonProhibited,
  268. TagReasonPersonalAttacks: ReasonPersonalAttacks,
  269. TagReasonSpoiler: ReasonSpoiler,
  270. TagReasonDelOtherTags: ReasonDelOtherTags,
  271. }
  272. // _orginMoralType 对应节操来源类型
  273. _orginMoralType = map[int8]int8{
  274. OriginReply: MoralOriginReply,
  275. OriginDM: MoralOriginDM,
  276. OriginTag: MoralOriginTag,
  277. }
  278. _blockDay = map[int8]string{
  279. BlockTimeForever: "永久封禁",
  280. BlockTimeThree: "封禁3天",
  281. BlockTimeSeven: "封禁7天",
  282. BlockTimeFifteen: "封禁15天",
  283. }
  284. )
  285. // ReasonToFreeze get reason yes or no to freeze.
  286. func ReasonToFreeze(reasonType int8) bool {
  287. return _reasonToFreeze[reasonType]
  288. }
  289. // OrginMoralType get moral bussiness Type by blocked orgin.
  290. func OrginMoralType(blockOrginType int8) int8 {
  291. return _orginMoralType[blockOrginType]
  292. }
  293. // PunishTypeDesc get punishType desc
  294. func PunishTypeDesc(punishType int8) string {
  295. return _punishType[punishType]
  296. }
  297. // ReasonTypeDesc get reasonType desc
  298. func ReasonTypeDesc(reasonType int8) string {
  299. return _reasonType[reasonType]
  300. }
  301. // OriginTypeDesc get originType desc
  302. func OriginTypeDesc(originType int8) string {
  303. return _originType[originType]
  304. }
  305. // BlockedDayDesc is blocked day desc
  306. func BlockedDayDesc(day int8) string {
  307. return _blockDay[day]
  308. }
  309. // BlockedReasonTypeByReply get blocked reason type.
  310. func BlockedReasonTypeByReply(replyReasonType int8) int8 {
  311. return _replyReasonType[replyReasonType]
  312. }
  313. // BlockedReasonTypeByTag get blocked reason type.
  314. func BlockedReasonTypeByTag(tagReasonType int8) int8 {
  315. return _tagReasonType[tagReasonType]
  316. }
  317. // OriginMsgContent get msg content by oTitle, oURL , oContent and oType
  318. func OriginMsgContent(oTitle, oURL, oContent string, oType int8) (msgTitle, msgCon string) {
  319. msgTitle = fmt.Sprintf(_dealMsgTitle, _originType[oType])
  320. msgCon = fmt.Sprintf(_dealMsgContent, oTitle, oURL, _originType[oType], oContent)
  321. return
  322. }