添加商品枚举

This commit is contained in:
puhui999 2023-05-01 14:47:00 +08:00
parent 15ced47b17
commit 6428f0fcaf

View File

@ -0,0 +1,65 @@
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;
/**
* 产品单位枚举
*
* @author HUIHUI
*/
@Getter
@AllArgsConstructor
public enum ProductUnitEnum implements IntArrayValuable {
PIECE(1, ""),
DOZEN(2, ""),
BOX(3, ""),
BAG(4, ""),
CASE(5, ""),
SET(6, ""),
PACK(7, ""),
PAIR(8, ""),
ROLL(9, ""),
SHEET(10, ""),
WEIGHT(11, ""),
KILOGRAM(12, "千克"),
MILLIGRAM(13, "毫克"),
MICROGRAM(14, "微克"),
TON(15, ""),
LITER(16, ""),
MILLILITER(17, "毫升"),
SQUARE_METER(19, "平方米"),
SQUARE_KILOMETER(20, "平方千米"),
SQUARE_MILE(21, "平方英里"),
SQUARE_YARD(22, "平方码"),
SQUARE_FOOT(23, "平方英尺"),
CUBIC_METER(24, "立方米"),
CUBIC_CENTIMETER(25, "立方厘米"),
CUBIC_INCH(26, "立方英寸"),
METER(27, ""),
CENTIMETER(29, "厘米"),
MILLIMETER(30, "毫米"),
INCH(31, "英寸"),
FOOT(32, "英尺"),
YARD(33, ""),
;
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ProductUnitEnum::getStatus).toArray();
/**
* 状态
*/
private final Integer status;
/**
* 状态名
*/
private final String name;
@Override
public int[] array() {
return ARRAYS;
}
}