You've already forked FrameTour-BE
价格查询,待处理订单内容
This commit is contained in:
31
src/main/java/com/ycwl/basic/pricing/enums/CouponStatus.java
Normal file
31
src/main/java/com/ycwl/basic/pricing/enums/CouponStatus.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package com.ycwl.basic.pricing.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 优惠券状态枚举
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum CouponStatus {
|
||||
|
||||
CLAIMED("claimed", "已领取"),
|
||||
USED("used", "已使用"),
|
||||
EXPIRED("expired", "已过期");
|
||||
|
||||
private final String code;
|
||||
private final String description;
|
||||
|
||||
/**
|
||||
* 根据代码获取枚举
|
||||
*/
|
||||
public static CouponStatus fromCode(String code) {
|
||||
for (CouponStatus status : values()) {
|
||||
if (status.code.equals(code)) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown coupon status code: " + code);
|
||||
}
|
||||
}
|
||||
30
src/main/java/com/ycwl/basic/pricing/enums/CouponType.java
Normal file
30
src/main/java/com/ycwl/basic/pricing/enums/CouponType.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.ycwl.basic.pricing.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 优惠券类型枚举
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum CouponType {
|
||||
|
||||
PERCENTAGE("percentage", "百分比折扣"),
|
||||
FIXED_AMOUNT("fixed_amount", "固定金额减免");
|
||||
|
||||
private final String code;
|
||||
private final String description;
|
||||
|
||||
/**
|
||||
* 根据代码获取枚举
|
||||
*/
|
||||
public static CouponType fromCode(String code) {
|
||||
for (CouponType type : values()) {
|
||||
if (type.code.equals(code)) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown coupon type code: " + code);
|
||||
}
|
||||
}
|
||||
33
src/main/java/com/ycwl/basic/pricing/enums/ProductType.java
Normal file
33
src/main/java/com/ycwl/basic/pricing/enums/ProductType.java
Normal file
@@ -0,0 +1,33 @@
|
||||
package com.ycwl.basic.pricing.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 商品类型枚举
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ProductType {
|
||||
|
||||
VLOG_VIDEO("vlog_video", "Vlog视频"),
|
||||
RECORDING_SET("recording_set", "录像集"),
|
||||
PHOTO_SET("photo_set", "照相集"),
|
||||
PHOTO_PRINT("photo_print", "照片打印"),
|
||||
MACHINE_PRINT("machine_print", "一体机打印");
|
||||
|
||||
private final String code;
|
||||
private final String description;
|
||||
|
||||
/**
|
||||
* 根据代码获取枚举
|
||||
*/
|
||||
public static ProductType fromCode(String code) {
|
||||
for (ProductType type : values()) {
|
||||
if (type.code.equals(code)) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown product type code: " + code);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user