|
@@ -40,6 +40,9 @@ public class CouponInfoVO {
|
|
|
@ApiModel("优惠券信息分页请求信息")
|
|
|
public static class PageRequest extends QueryInfo {
|
|
|
|
|
|
+ @ApiModelProperty(value = "优惠券ID", hidden = true)
|
|
|
+ private Long couponId;
|
|
|
+
|
|
|
@ApiModelProperty("优惠券名称")
|
|
|
private String name;
|
|
|
|
|
@@ -52,16 +55,42 @@ public class CouponInfoVO {
|
|
|
@ApiModelProperty("可用品类")
|
|
|
private CouponCategoryEnum category;
|
|
|
|
|
|
+ @ApiModelProperty("优惠券状态")
|
|
|
+ private Integer status;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "当前时间", hidden = true)
|
|
|
+ private Long timestamp;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "优惠券时间类型", hidden = true)
|
|
|
+ private CouponValidTypeEnum validType;
|
|
|
+
|
|
|
public String jsonString() {
|
|
|
return JSON.toJSONString(this);
|
|
|
}
|
|
|
|
|
|
public String getName() {
|
|
|
|
|
|
- if (StringUtils.isEmpty(this.name)) {
|
|
|
- return null;
|
|
|
+ return Optional.ofNullable(this.name).filter(x -> !x.matches(MK.EXP_INT)).orElse(null);
|
|
|
+ }
|
|
|
+
|
|
|
+ public Long getCouponId() {
|
|
|
+ if (StringUtils.isNotEmpty(this.name) && this.name.matches(MK.EXP_INT)) {
|
|
|
+ return Long.parseLong(this.name);
|
|
|
}
|
|
|
- return name;
|
|
|
+ return couponId;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setStatus(Integer status) {
|
|
|
+
|
|
|
+ if (EStatus.ENABLE.match(status)) {
|
|
|
+ this.timestamp(DateTime.now().getMillis()).setValidType(CouponValidTypeEnum.DAY);
|
|
|
+ }
|
|
|
+ this.status = status;
|
|
|
+ }
|
|
|
+
|
|
|
+ public PageRequest timestamp(Long timestamp) {
|
|
|
+ this.timestamp = timestamp;
|
|
|
+ return this;
|
|
|
}
|
|
|
}
|
|
|
|