mall:优化商品表的设计

This commit is contained in:
YunaiV
2022-08-04 23:25:44 +08:00
parent c612487198
commit 33a01e78bf
7 changed files with 179 additions and 65 deletions

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.product.enums.comment;
package cn.iocoder.yudao.module.product.enums.spu;
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
import lombok.AllArgsConstructor;
@ -7,26 +7,25 @@ import lombok.Getter;
import java.util.Arrays;
/**
* 商品评论的评价枚举
* 商品 SPU 规格类型
*
* @author 芋道源码
*/
@Getter
@AllArgsConstructor
public enum ProductCommentEvaluateEnum implements IntArrayValuable {
public enum ProductSpuSpecTypeEnum implements IntArrayValuable {
GOOD(1, "好评"),
BAD(2, "差评"),
MIDDLE(2, "中评"),;
RECYCLE(1, "统一规格"),
DISABLE(2, "多规格");
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ProductCommentEvaluateEnum::getEvaluate).toArray();
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ProductSpuSpecTypeEnum::getType).toArray();
/**
* 评价
* 规格
*/
private final Integer evaluate;
private final Integer type;
/**
* 评价
* 规格
*/
private final String name;

View File

@ -0,0 +1,38 @@
package cn.iocoder.yudao.module.product.enums.spu;
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
/**
* 商品 SPU 状态
*
* @author 芋道源码
*/
@Getter
@AllArgsConstructor
public enum ProductSpuStatusEnum implements IntArrayValuable {
RECYCLE(-1, "回收站"),
DISABLE(0, "下架"),
ENABLE(1, "上架"),;
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ProductSpuStatusEnum::getStyle).toArray();
/**
* 状态
*/
private final Integer style;
/**
* 状态名
*/
private final String name;
@Override
public int[] array() {
return ARRAYS;
}
}