Commit 6428f0fcafdb667c0266fe3d2df90ff323285b14
1 parent
15ced47b
添加商品枚举
Showing
1 changed file
with
65 additions
and
0 deletions
yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/spu/ProductUnitEnum.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.product.enums.spu; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.core.IntArrayValuable; | |
| 4 | +import lombok.AllArgsConstructor; | |
| 5 | +import lombok.Getter; | |
| 6 | + | |
| 7 | +import java.util.Arrays; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * 产品单位枚举 | |
| 11 | + * | |
| 12 | + * @author HUIHUI | |
| 13 | + */ | |
| 14 | +@Getter | |
| 15 | +@AllArgsConstructor | |
| 16 | +public enum ProductUnitEnum implements IntArrayValuable { | |
| 17 | + PIECE(1, "个"), | |
| 18 | + DOZEN(2, "打"), | |
| 19 | + BOX(3, "盒"), | |
| 20 | + BAG(4, "袋"), | |
| 21 | + CASE(5, "箱"), | |
| 22 | + SET(6, "套"), | |
| 23 | + PACK(7, "包"), | |
| 24 | + PAIR(8, "双"), | |
| 25 | + ROLL(9, "卷"), | |
| 26 | + SHEET(10, "张"), | |
| 27 | + WEIGHT(11, "克"), | |
| 28 | + KILOGRAM(12, "千克"), | |
| 29 | + MILLIGRAM(13, "毫克"), | |
| 30 | + MICROGRAM(14, "微克"), | |
| 31 | + TON(15, "吨"), | |
| 32 | + LITER(16, "升"), | |
| 33 | + MILLILITER(17, "毫升"), | |
| 34 | + SQUARE_METER(19, "平方米"), | |
| 35 | + SQUARE_KILOMETER(20, "平方千米"), | |
| 36 | + SQUARE_MILE(21, "平方英里"), | |
| 37 | + SQUARE_YARD(22, "平方码"), | |
| 38 | + SQUARE_FOOT(23, "平方英尺"), | |
| 39 | + CUBIC_METER(24, "立方米"), | |
| 40 | + CUBIC_CENTIMETER(25, "立方厘米"), | |
| 41 | + CUBIC_INCH(26, "立方英寸"), | |
| 42 | + METER(27, "米"), | |
| 43 | + CENTIMETER(29, "厘米"), | |
| 44 | + MILLIMETER(30, "毫米"), | |
| 45 | + INCH(31, "英寸"), | |
| 46 | + FOOT(32, "英尺"), | |
| 47 | + YARD(33, "码"), | |
| 48 | + ; | |
| 49 | + | |
| 50 | + public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ProductUnitEnum::getStatus).toArray(); | |
| 51 | + | |
| 52 | + /** | |
| 53 | + * 状态 | |
| 54 | + */ | |
| 55 | + private final Integer status; | |
| 56 | + /** | |
| 57 | + * 状态名 | |
| 58 | + */ | |
| 59 | + private final String name; | |
| 60 | + | |
| 61 | + @Override | |
| 62 | + public int[] array() { | |
| 63 | + return ARRAYS; | |
| 64 | + } | |
| 65 | +} | ... | ... |