完善了小程序端用户创建订单接口

This commit is contained in:
chen-xin-zhi 2024-11-09 16:26:52 +08:00
parent 5417c5d3d7
commit 70b097f267
3 changed files with 56 additions and 1 deletions

View File

@ -3,7 +3,6 @@ package com.cultural.heritage.model.enums;
import lombok.Getter;
import org.springframework.util.ObjectUtils;
import java.io.File;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

View File

@ -0,0 +1,50 @@
package com.cultural.heritage.model.enums;
import org.springframework.util.ObjectUtils;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* 商品类型枚举类
*/
public enum GoodTypeEnum {
PRODUCT("常规类商品", "product"),
SERVICE("服务类商品", "service");
private final String text;
private final String value;
GoodTypeEnum(String text, String value) {
this.text = text;
this.value = value;
}
/**
* 获取值列表
*/
public static List<String> getValues() {
return Arrays.stream(values()).map(item -> item.value).collect(Collectors.toList());
}
/**
* 根据 value 获取枚举
*/
public static GoodTypeEnum getEnumByValue(String value) {
if (ObjectUtils.isEmpty(value)) {
return null;
}
for (GoodTypeEnum anEnum : GoodTypeEnum.values()) {
if (anEnum.value.equals(value)) {
return anEnum;
}
}
return null;
}
}

View File

@ -34,6 +34,12 @@ public class GoodVO implements Serializable {
private String goodImg;
/**
* 商品库存量
*/
private Integer inventory;
/**
* 商品标签
*/