Coupon.java 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. package com.cyksj.model.entity;
  2. import com.baomidou.mybatisplus.annotation.TableLogic;
  3. import lombok.Getter;
  4. import lombok.Setter;
  5. import javax.validation.constraints.NotEmpty;
  6. import javax.validation.constraints.NotNull;
  7. import java.math.BigDecimal;
  8. import java.util.Date;
  9. /*
  10. *项目名: netflix
  11. *文件名: Coupon
  12. *创建者: JavaZou
  13. *创建时间:2022/11/17 15:49
  14. */
  15. @Getter
  16. @Setter
  17. public class Coupon extends BaseEntity {
  18. /**
  19. * 优惠券名称
  20. */
  21. @NotEmpty(message = "优惠券名称不能为空")
  22. private String name;
  23. /**
  24. * 优惠券平台类型
  25. */
  26. @NotNull(message = "优惠券平台类型不能为空")
  27. private GoodsType goodsType;
  28. /**
  29. * 优惠券类型
  30. */
  31. @NotNull(message = "优惠券类型不能为空")
  32. private Type type;
  33. /**
  34. * 可用满减卷金额条件
  35. */
  36. private BigDecimal reduceCondition;
  37. /**
  38. * 抵扣金额
  39. */
  40. private BigDecimal reduceMoney;
  41. /**
  42. * 折扣
  43. */
  44. private BigDecimal discount;
  45. /**
  46. * 领取人范围
  47. */
  48. @NotNull(message = "领取人不能为空")
  49. private Scope scope;
  50. /**
  51. * 平台规格集合
  52. */
  53. @NotEmpty
  54. private String goodsSkuIds;
  55. /**
  56. * 是否是有效时间
  57. */
  58. private Boolean isValidTime;
  59. /**
  60. * 起始有效时间
  61. */
  62. private Date validStartTime;
  63. /**
  64. * 截止有效时间
  65. */
  66. private Date validEndTime;
  67. /**
  68. * 领取有效天数
  69. */
  70. private Integer validDays;
  71. /**
  72. * 是否可在续费时使用
  73. */
  74. private Boolean isRenew;
  75. /**
  76. * 兑换码
  77. */
  78. private String exCode;
  79. /**
  80. * 发放状态
  81. */
  82. private Boolean sendStatus;
  83. /**
  84. * 推荐状态
  85. */
  86. private Boolean hotStatus;
  87. @TableLogic(value = "1", delval = "0")
  88. private Boolean deleted;
  89. @Getter
  90. public enum GoodsType {
  91. realGoods("实物"),
  92. virtualGoods("虚物"),
  93. ;
  94. String type;
  95. GoodsType(String type) {
  96. this.type = type;
  97. }
  98. }
  99. @Getter
  100. public enum Type {
  101. reduce("立减卷"),
  102. discount("折扣卷"),
  103. ;
  104. String desc;
  105. Type(String desc) {
  106. this.desc = desc;
  107. }
  108. }
  109. @Getter
  110. public enum Scope {
  111. everyone("所有人"),
  112. newUser("新用户"),
  113. ;
  114. String desc;
  115. Scope(String desc) {
  116. this.desc = desc;
  117. }
  118. }
  119. @Getter
  120. @Setter
  121. public static class CouponGoodsSku {
  122. private Long goodsId;
  123. private Long skuId;
  124. }
  125. }