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
| package com.ruoyi.order.enums;
|
| import lombok.Getter;
|
| @Getter
| public enum OrderType {
| SERVICE(1, "服务单"),
| GOOD(2, "商品单");
|
| private final int code;
| private final String description;
|
| OrderType(int code, String description) {
| this.code = code;
| this.description = description;
| }
|
| public static OrderType fromCode(int code) {
| for (OrderType type : OrderType.values()) {
| if (type.getCode() == code) {
| return type;
| }
| }
| return null;
| }
| }
|
|