bbq_ecode.go 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. package ecode
  2. // bbq ecode interval is [5000000,6000000)
  3. var (
  4. CheckInviteCodeErr = New(3001016) // 检查邀请码失败(特殊处理请勿修改) todo
  5. //Common [5000000,5001000)
  6. Common = New(5000000)
  7. TypeDismatch = New(5000001) // 类型不匹配
  8. ExternalErr = New(5000002) // 外部错误
  9. ReqParamErr = New(5000003) // 参数错误
  10. BBQSystemErr = New(5000004) // 用于一些异常请求
  11. BBQNoBindPhone = New(5000005) // 未绑定手机号
  12. BBQUserBanned = New(5000006) // 已被封禁,无法进行相关操作,如有疑问可在“设置-吐槽”中进行反馈
  13. ArchiveDatabusNilErr = New(5000007) // 预发环境不配置稿件databus
  14. //Search [5001000,5002000)
  15. SearchCreateIndexErr = New(5001000) // 创建索引失败
  16. SearchVideoDataErr = New(5001001) // 获取视频信息失败
  17. //web [5002000,5003000)
  18. CommentClosed = New(5002001) // 评论已关闭
  19. VideoUnExists = New(5002003) // 视频不存在
  20. VideoUnReachable = New(5002004) // 视频不存在,由于状态原因不可访问
  21. VideoInAudit = New(5002005) // 视频审核中
  22. InviteCodeInvalid = New(5002014) // 无效邀请码
  23. InviteCodeUsed = New(5002015) // 邀请码已使用
  24. CommentForbidden = New(5002021) // 禁止评论
  25. CommentTooShort = New(5002023) // 评论过短
  26. CommentTooLong = New(5002024) // 评论过长
  27. SvNotReachable = New(5002025)
  28. NoticeTypeErr = New(5002026) // 通知类型错误
  29. CommentForbidLike = New(5002027) // 禁止赞或踩
  30. CommentLengthIllegal = New(5002028) // 评论长度不合法
  31. //video-service [5003000,5004000)
  32. UnKnownBPS = New(5003000) // 未知码率
  33. SyncBVCFail = New(5003001) // 同步bvc转码失败
  34. VideoDelFail = New(5003002) // 视频删除失败,不能删除别人的视频
  35. // UserLike [5005000, 5005100]
  36. UserLike = New(5005000) // UserLike [5005000, 5005100]
  37. AddUserLikeErr = New(5005001) // 点赞失败
  38. CancelUserLikeErr = New(5005002) // 取消点赞失败
  39. // UserInfo [5005100, 5005200]
  40. UserInfo = New(5005100) // UserInfo
  41. BatchUserTooLong = New(5005101) // 用户批量请求太多
  42. UPMIDNotExists = New(5005102) // up主不存在
  43. GetUserBaseErr = New(5005103) // 获取用户信息失败
  44. EditUserBaseErr = New(5005104) // 更新用户基础信息失败
  45. UserUnameSpecial = New(5005105) // 昵称包含特殊字符
  46. UserUnameLength = New(5005106) // 昵称长度不符合
  47. UserUnameExisted = New(5005107) // 昵称已被占用
  48. UserUnameFilterErr = New(5005108) // 昵称包含敏感词
  49. UserUnamePrefixErr = New(5005109) // 该昵称无法注册
  50. // UserRelation [5005200, 5005300]
  51. UserRelation = New(5005200)
  52. AddUserFollowErr = New(5005201) // 关注失败,请稍后重试
  53. CancelUserFollowErr = New(5005202) // 取消关注失败,请稍后重试
  54. UserFollowLimitErr = New(5005203) // 关注失败,关注已达上限
  55. FollowMyselfErr = New(5005204) // 不能关注自己
  56. UserAlreadyBlackFollowErr = New(5005205) // 关注失败,请将用户移出黑名单后重试
  57. UserBlackLimitErr = New(5005206) // 拉黑失败,黑名单已达上限
  58. UserBlackErr = New(5005207) // 黑名单请求系统错误
  59. UserBlackSelfErr = New(5005208) // 拉黑失败,不能拉黑自己
  60. // Danmu [5005300, 5005400]
  61. Danmu = New(5005300)
  62. FilterErr = New(5005301) // 弹幕包含敏感词
  63. DanmuGetErr = New(5005302) // 弹幕获取失败
  64. DanmuPostErr = New(5005303) // 弹幕发送失败
  65. DanmuLimitErr = New(5005304) // 该视频暂时无法发送弹幕
  66. // Comment [5005400, 5005500]
  67. Comment = New(5005400)
  68. CommentFilterErr = New(5005401) // 评论包含敏感词
  69. CommentMissErr = New(5005402) // 评论不见了
  70. CommentLengthErr = New(5005403) // 评论需要2-96字
  71. CommentOptLimitErr = New(5005404) // 操作太快了,休息一下
  72. CommentLimithErr = New(5005405) // 该视频暂时无法发送评论
  73. // report [5005500, 5005599]
  74. ReportDanmuError = New(5005501) // 弹幕举报失败
  75. //Upload [5005600, 5005700]
  76. Upload = New(5005600)
  77. UploadFailed = New(5005601) //上传失败
  78. // Topic [5005700, 5005800]
  79. Topic = New(5005700)
  80. TopicReqParamErr = New(5005701) // 参数错误
  81. TopicNumTooManyErr = New(5005702) // 一次性插入db的话题数量太大
  82. TopicNameLenErr = New(5005703) // 话题长度太长
  83. TopicIDErr = New(5005704) // 话题ID错误
  84. TopicIDNotFound = New(5005705) // 话题ID没找到
  85. TopicStateErr = New(5005706) // 话题为下架状态
  86. TopicTooManyInOneVideo = New(5005707) // 一个视频的话题数量太多了
  87. TopicDescLenErr = New(5005708) // 话题描述长度太长
  88. TopicInsertErr = New(5005709) // 话题插入失败
  89. TopicVideoStateErr = New(5005721) // 话题视频状态错误
  90. )
  91. // 可以取消点赞的状态
  92. var svLikeCancelAvailableState = map[error]bool{
  93. VideoUnReachable: true,
  94. VideoInAudit: true,
  95. }
  96. // IsCancelSvLikeAvailable 可以取消点赞的状态
  97. func IsCancelSvLikeAvailable(err error) (available bool) {
  98. _, available = svLikeCancelAvailableState[err]
  99. return
  100. }