【功能修复】商城:指定发卷、新人卷,支持无限发放的兜底

This commit is contained in:
YunaiV
2024-09-11 20:55:28 +08:00
parent 5f7505d4ac
commit 9805f9f512
4 changed files with 19 additions and 10 deletions

View File

@ -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);
}
}