提交 | 用户 | 时间
|
7fd198
|
1 |
package com.iailab.module.model.mcs.pre.enums; |
潘 |
2 |
|
|
3 |
import lombok.AllArgsConstructor; |
|
4 |
import lombok.Getter; |
|
5 |
|
|
6 |
/** |
|
7 |
* @author PanZhibao |
|
8 |
* @Description |
|
9 |
* @createTime 2024年09月01日 |
|
10 |
*/ |
|
11 |
@Getter |
|
12 |
@AllArgsConstructor |
|
13 |
public enum ItemStatus { |
|
14 |
STATUS0(0, "禁用"), |
|
15 |
STATUS1(0, "启用"); |
|
16 |
|
|
17 |
private Integer code; |
|
18 |
private String desc; |
|
19 |
|
|
20 |
public static ItemStatus getEumByCode(Integer code) { |
|
21 |
if (code == null) { |
|
22 |
return null; |
|
23 |
} |
|
24 |
|
|
25 |
for (ItemStatus statusEnum : ItemStatus.values()) { |
|
26 |
if (statusEnum.getCode().equals(code)) { |
|
27 |
return statusEnum; |
|
28 |
} |
|
29 |
} |
|
30 |
return null; |
|
31 |
} |
|
32 |
} |