meta.go 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. package service
  2. import "strconv"
  3. // BusinessRoleState business->role->state
  4. var (
  5. _state = map[int8]map[int8]map[int8]string{
  6. 1: {0: {0: "投诉刚创建", 1: "被接受", 2: "被驳回"}},
  7. 2: {0: {0: "未处理", 1: "有效", 2: "无效"}, 1: {1: "未处理", 2: "已回复已读", 3: "管理员关闭", 4: "用户已解决", 5: "过期自动关闭", 6: "已回复未读", 7: "用户关闭", 8: "通过关闭"}},
  8. 3: {0: {0: "投诉刚创建", 1: "被接受", 2: "被驳回"}},
  9. 4: {0: {0: "投诉刚创建", 1: "被接受", 2: "被驳回"}},
  10. 5: {0: {0: "未处理", 1: "有效", 2: "无效"}, 1: {1: "未处理", 2: "已回复已读", 3: "管理员关闭", 4: "用户已解决", 5: "过期自动关闭", 6: "已回复未读", 7: "用户关闭", 8: "通过关闭"}},
  11. 6: {0: {0: "未处理", 1: "通过", 2: "驳回", 3: "失效"}},
  12. 8: {0: {0: "未处理", 1: "有效", 2: "无效"}},
  13. 9: {0: {0: "未处理", 1: "有效", 2: "无效"}},
  14. 13: {0: {0: "未处理", 1: "有效", 2: "无效", 9: "已删除", 10: "移交众裁"}},
  15. 14: {0: {0: "未处理", 1: "有效", 2: "无效"}},
  16. }
  17. // BusinessIDName bid->name
  18. _business = map[int8]string{
  19. 1: "稿件投诉",
  20. 2: "稿件申诉",
  21. 3: "短点评投诉",
  22. 4: "长点评投诉",
  23. 5: "小黑屋申诉",
  24. 6: "稿件审核",
  25. 7: "任务质检",
  26. 8: "音频Tag",
  27. 9: "频道举报",
  28. 13: "评论举报",
  29. 14: "字幕举报",
  30. }
  31. _role = map[int8]string{
  32. 0: "处理",
  33. 1: "反馈",
  34. }
  35. _flow = map[int8]string{
  36. 0: "审核流",
  37. 1: "投诉流",
  38. 2: "申诉流",
  39. }
  40. )
  41. // StateDescr state description
  42. func (s *Service) StateDescr(business, role, state int8) string {
  43. //TODO: describe all states
  44. stateStr, ok := _state[business][role][state]
  45. if !ok {
  46. return strconv.Itoa(int(state))
  47. }
  48. return stateStr
  49. }
  50. // StateDescV3 .
  51. func (s *Service) StateDescV3(business, fid, state int8) string {
  52. return ""
  53. }
  54. // BusinessDesc business description
  55. func (s *Service) BusinessDesc(business int8) string {
  56. busStr, ok := _business[business]
  57. if !ok {
  58. return strconv.Itoa(int(business))
  59. }
  60. return busStr
  61. }
  62. // RoleDesc role description
  63. func (s *Service) RoleDesc(role int8) string {
  64. roleStr, ok := _role[role]
  65. if !ok {
  66. return strconv.Itoa(int(role))
  67. }
  68. return roleStr
  69. }
  70. // FlowDesc .
  71. func (s *Service) FlowDesc(fid int8) string {
  72. flowStr, ok := _flow[fid]
  73. if !ok {
  74. return strconv.Itoa(int(fid))
  75. }
  76. return flowStr
  77. }
  78. // RidDesc .
  79. func (s *Service) RidDesc(bid, rid int8) string {
  80. roleStr, ok := s.roleCache[bid][rid]
  81. if !ok {
  82. return strconv.Itoa(int(rid))
  83. }
  84. return roleStr
  85. }