mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-24 16:05:08 +08:00
mall:优化商品表的设计
This commit is contained in:
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user