oper.go 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. package model
  2. import (
  3. "fmt"
  4. )
  5. // .
  6. const (
  7. // OperTypeMission 活动id被修改
  8. OperTypeMission = int8(1)
  9. // OperTypeTag tag被修改
  10. OperTypeTag = int8(2)
  11. // OperTypeCopyright 版权类型被修改
  12. OperTypeCopyright = int8(3)
  13. // OperTypeTypeID 分区ID被修改
  14. OperTypeTypeID = int8(4)
  15. // OperTypeRejectReason 打回理由被修改
  16. OperTypeRejectReason = int8(5)
  17. // OperTypeForwardID 转车跳转被修改
  18. OperTypeForwardID = int8(6)
  19. // OperTypeFlowID 私单类型被修改
  20. OperTypeFlowID = int8(7)
  21. // OperTypeDelay 定时发布被修改
  22. OperTypeDelay = int8(8)
  23. // OperTypeReply 评论开关被修改
  24. OperTypeReply = int8(9)
  25. // OperTypePtime 发布时间被修改
  26. OperTypePtime = int8(10)
  27. // OperTypeAccess 可见属性被修改
  28. OperTypeAccess = int8(11)
  29. // OperTypeAduitReason 审核理由被修改
  30. OperTypeAduitReason = int8(12)
  31. // OperTypeRecicleTag 打回理由被修改
  32. OperTypeRecicleTag = int8(13)
  33. // OperTypeTaskID 任务ID被修改
  34. OperTypeTaskID = int8(14)
  35. // OperTypeOpenTag 通过Tag被修改
  36. OperTypeOpenTag = int8(15)
  37. // OperTypeDynamic 动态描述被修改
  38. OperTypeDynamic = int8(16)
  39. OperNotify = int8(17)
  40. //私单
  41. OperPorderIndustryID = int8(18)
  42. OperPorderOfficial = int8(19)
  43. OperPorderBrandID = int8(20)
  44. OperPorderBrandName = int8(21)
  45. OperPorderShowType = int8(22)
  46. OperPorderAdvertiser = int8(23)
  47. OperPorderAgent = int8(24)
  48. OperPorderShowFront = int8(25)
  49. //频道回查属性
  50. OperFlowAttrNoChannel = int8(26)
  51. OperFlowAttrNoHot = int8(27)
  52. // OperStyleOne 操作展示类型1:[%s]从[%v]设为[%v]
  53. OperStyleOne = int8(1)
  54. // OperStyleTwo 操作展示类型2:[%s]%v:%v
  55. OperStyleTwo = int8(2)
  56. )
  57. //VOper video oper
  58. type VOper struct {
  59. ID int64 `json:"id"`
  60. AID int64 `json:"aid"`
  61. UID int64 `json:"uid"`
  62. VID int64 `json:"vid"`
  63. Status int16 `json:"status"`
  64. Content string `json:"content"`
  65. Attribute int64 `json:"attribute"`
  66. LastID int64 `json:"last_id"`
  67. Remark string `json:"remark"`
  68. CTime string `json:"ctime"`
  69. }
  70. //VideoOperInfo video oper with user info
  71. type VideoOperInfo struct {
  72. VOper
  73. UserDepart
  74. }
  75. var (
  76. _operType = map[int8]string{
  77. OperTypeMission: "活动ID",
  78. OperTypeTag: "TAG内容",
  79. OperTypeCopyright: "投稿类型",
  80. OperTypeTypeID: "分区类型",
  81. OperTypeRejectReason: "回查理由",
  82. OperTypeForwardID: "撞车跳转",
  83. OperTypeFlowID: "流量TAG",
  84. OperTypeDelay: "定时发布",
  85. OperTypeReply: "评论开关",
  86. OperTypePtime: "发布时间",
  87. OperTypeAccess: "可见属性",
  88. OperTypeAduitReason: "审核理由",
  89. OperTypeRecicleTag: "打回Tag",
  90. OperTypeTaskID: "任务ID",
  91. OperTypeOpenTag: "通过Tag",
  92. OperTypeDynamic: "动态描述",
  93. OperNotify: "系统通知",
  94. OperPorderIndustryID: "推广行业",
  95. OperPorderOfficial: "是否官方",
  96. OperPorderBrandID: "推广品牌ID",
  97. OperPorderBrandName: "推广品牌",
  98. OperPorderShowType: "推广形式",
  99. OperPorderAdvertiser: "广告主",
  100. OperPorderAgent: "代理商",
  101. OperPorderShowFront: "是否前端展示",
  102. OperFlowAttrNoChannel: "频道禁止",
  103. OperFlowAttrNoHot: "热门禁止",
  104. }
  105. )
  106. // ArcOper archive oper.
  107. type ArcOper struct {
  108. ID int64
  109. Aid int64
  110. UID int64
  111. TypeID int16
  112. State int16
  113. Content string
  114. Round int8
  115. Attribute int32
  116. LastID int64
  117. Remark string
  118. }
  119. // VideoOper video oper.
  120. type VideoOper struct {
  121. ID int64
  122. Aid int64
  123. UID int64
  124. Vid int64
  125. Status int16
  126. Content string
  127. Attribute int32
  128. LastID int64
  129. Remark string
  130. }
  131. // Operformat oper format.
  132. func Operformat(tagID int8, old, new interface{}, style int8) (cont string) {
  133. var template string
  134. switch style {
  135. case OperStyleOne:
  136. template = "[%s]从[%v]设为[%v]"
  137. case OperStyleTwo:
  138. template = "[%s]%v:%v"
  139. }
  140. cont = fmt.Sprintf(template, _operType[tagID], old, new)
  141. return
  142. }