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
| package com.ruoyi.dataInterchange.api.model.enums;
|
| /**
| * 车辆颜色枚举
| *
| * @author zhibing.pu
| * @Date 2025/3/17 14:18
| */
| public enum VehicleColorEnum {
| BLUE(1, "蓝色"),
| YELLOW(2, "黄色"),
| BLACK(3, "黑色"),
| WHITE(4, "白色"),
| OTHER(9, "其他"),
| ;
| private Integer code;
| private String name;
|
| VehicleColorEnum(Integer code, String name) {
| this.code = code;
| this.name = name;
| }
|
|
| public static String getName(Integer num) {
| VehicleColorEnum[] values = VehicleColorEnum.values();
| for (VehicleColorEnum value : values) {
| if (value.code.equals(num)) {
| return value.name;
| }
| }
| return "";
| }
| }
|
|