1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
| package cn.iocoder.yudao.module.product.enums.comment;
|
| import cn.iocoder.yudao.framework.common.core.ArrayValuable;
| import lombok.AllArgsConstructor;
| import lombok.Getter;
|
| import java.util.Arrays;
|
| /**
| * 商品评论的星级枚举
| *
| * @author wangzhs
| */
| @Getter
| @AllArgsConstructor
| public enum ProductCommentScoresEnum implements ArrayValuable<Integer> {
|
| ONE(1, "1星"),
| TWO(2, "2星"),
| THREE(3, "3星"),
| FOUR(4, "4星"),
| FIVE(5, "5星");
|
| public static final Integer[] ARRAYS = Arrays.stream(values()).map(ProductCommentScoresEnum::getScores).toArray(Integer[]::new);
|
| /**
| * 星级
| */
| private final Integer scores;
|
| /**
| * 星级名
| */
| private final String name;
|
| @Override
| public Integer[] array() {
| return ARRAYS;
| }
|
| }
|
|