附近小店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

191 lines
4.5 KiB

  1. package enum
  2. // ActCouponType 优惠券类型
  3. type ActCouponType int
  4. const (
  5. ActCouponTypeImmediate ActCouponType = iota + 1 // 立减
  6. ActCouponTypeReachReduce // 满减
  7. ActCouponTypeReachDiscount // 满折
  8. )
  9. func (em ActCouponType) String() string {
  10. switch em {
  11. case ActCouponTypeImmediate:
  12. return "立减券"
  13. case ActCouponTypeReachReduce:
  14. return "满减券"
  15. case ActCouponTypeReachDiscount:
  16. return "折扣券"
  17. default:
  18. return "未知类型"
  19. }
  20. }
  21. // ActCouponSendWay 发放形式
  22. type ActCouponSendWay int
  23. const (
  24. ActCouponSendWayPositive ActCouponSendWay = iota + 1
  25. ActCouponSendWayManual
  26. )
  27. func (em ActCouponSendWay) String() string {
  28. switch em {
  29. case ActCouponSendWayPositive:
  30. return "主动发放"
  31. case ActCouponSendWayManual:
  32. return "手动领取"
  33. default:
  34. return "未知类型"
  35. }
  36. }
  37. // ActCouponSendTimeType 发放时间类型
  38. type ActCouponSendTimeType int
  39. const (
  40. ActCouponSendTimeTypeImmediate ActCouponSendTimeType = iota + 1
  41. ActCouponSendTimeTypeTiming
  42. )
  43. func (em ActCouponSendTimeType) String() string {
  44. switch em {
  45. case ActCouponSendTimeTypeImmediate:
  46. return "立即发放"
  47. case ActCouponSendTimeTypeTiming:
  48. return "定时"
  49. default:
  50. return "未知类型"
  51. }
  52. }
  53. // ActCouponSendUserType 发放用户
  54. type ActCouponSendUserType int
  55. const (
  56. ActCouponSendUserTypeLevel ActCouponSendUserType = iota + 1
  57. ActCouponSendUserTypeAll
  58. ActCouponSendUserTypeSpecify
  59. )
  60. func (em ActCouponSendUserType) String() string {
  61. switch em {
  62. case ActCouponSendUserTypeLevel:
  63. return "指定会员等级"
  64. case ActCouponSendUserTypeAll:
  65. return "所有人可领"
  66. case ActCouponSendUserTypeSpecify:
  67. return "指定用户"
  68. default:
  69. return "未知类型"
  70. }
  71. }
  72. // ActCouponValidTimeType 有效时间
  73. type ActCouponValidTimeType int
  74. const (
  75. ActCouponValidTimeTypeFix ActCouponValidTimeType = iota + 1 // 固定日期
  76. ActCouponValidTimeTypeXDay // 领取当日开始计算有效期
  77. ActCouponValidTimeTypeXNextDay // 领取次日开始计算有效期
  78. )
  79. func (em ActCouponValidTimeType) String() string {
  80. switch em {
  81. case ActCouponValidTimeTypeFix:
  82. return "固定日期"
  83. case ActCouponValidTimeTypeXDay:
  84. return "自领取当日起,%d天内有效"
  85. case ActCouponValidTimeTypeXNextDay:
  86. return "自领取次日起,%d天内有效"
  87. default:
  88. return "未知类型"
  89. }
  90. }
  91. // ActCouponUseRule 使用规则
  92. type ActCouponUseRule int
  93. const (
  94. ActCouponUseRuleAll ActCouponUseRule = iota + 1 // 全部商品可用
  95. ActCouponUseRuleSpecifyGoods // 仅可用于指定商品
  96. ActCouponUseRuleSpecifyActivity // 可用于活动类型
  97. )
  98. func (em ActCouponUseRule) String() string {
  99. switch em {
  100. case ActCouponUseRuleAll:
  101. return "全部商品可用"
  102. case ActCouponUseRuleSpecifyGoods:
  103. return "仅可用于指定商品"
  104. case ActCouponUseRuleSpecifyActivity:
  105. return "可用于活动类型"
  106. default:
  107. return "未知类型"
  108. }
  109. }
  110. type ActCouponUseActivityType int
  111. const (
  112. ActCouponUseActivityTypeForGroup ActCouponUseActivityType = iota + 1
  113. ActCouponUseActivityTypeForSecondKill
  114. ActCouponUseActivityTypeForBargain
  115. )
  116. func (em ActCouponUseActivityType) String() string {
  117. switch em {
  118. case ActCouponUseActivityTypeForGroup:
  119. return "拼团活动"
  120. case ActCouponUseActivityTypeForSecondKill:
  121. return "秒杀活动"
  122. case ActCouponUseActivityTypeForBargain:
  123. return "砍价活动"
  124. default:
  125. return "未知类型"
  126. }
  127. }
  128. type ActCouponSendState int
  129. const (
  130. ActCouponSendStateUnProvide ActCouponSendState = iota + 1 // 未发放
  131. ActCouponSendStateProvide // 已发放
  132. ActCouponSendStateProviding // 发放中
  133. )
  134. func (em ActCouponSendState) String() string {
  135. switch em {
  136. case ActCouponSendStateUnProvide:
  137. return "未发放"
  138. case ActCouponSendStateProvide:
  139. return "已发放"
  140. case ActCouponSendStateProviding:
  141. return "发放中"
  142. default:
  143. return "未知类型"
  144. }
  145. }
  146. type ActUserCouponUseState int
  147. const (
  148. ActUserCouponUseStateUnUse ActUserCouponUseState = iota // 未使用
  149. ActUserCouponUseStateUsed // 已使用
  150. ActUserCouponUseStateUnValid // 失效
  151. )
  152. func (em ActUserCouponUseState) String() string {
  153. switch em {
  154. case ActUserCouponUseStateUnUse:
  155. return "未使用"
  156. case ActUserCouponUseStateUsed:
  157. return "已使用"
  158. case ActUserCouponUseStateUnValid:
  159. return "失效"
  160. default:
  161. return "未知类型"
  162. }
  163. }