mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-24 16:05:08 +08:00
【功能修复】商城:指定发卷、新人卷,支持无限发放的兜底
This commit is contained in:
@ -5,6 +5,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 优惠劵领取方式
|
||||
@ -20,12 +21,12 @@ public enum CouponTakeTypeEnum implements IntArrayValuable {
|
||||
REGISTER(3, "新人券"), // 注册时自动领取
|
||||
;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CouponTakeTypeEnum::getValue).toArray();
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CouponTakeTypeEnum::getType).toArray();
|
||||
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
private final Integer value;
|
||||
private final Integer type;
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
@ -35,4 +36,9 @@ public enum CouponTakeTypeEnum implements IntArrayValuable {
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
public static boolean isUser(Integer type) {
|
||||
return Objects.equals(USER.getType(), type);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user