2 changed files with 56 additions and 0 deletions
@ -0,0 +1,52 @@ |
|||||
|
package com.tduck.cloud.project.entity.enums; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.EnumValue; |
||||
|
import com.fasterxml.jackson.annotation.JsonCreator; |
||||
|
import com.fasterxml.jackson.annotation.JsonValue; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Getter; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
/** |
||||
|
* @author : smalljop |
||||
|
* @description : 项目所属类型 |
||||
|
* @create : 2020-12-04 13:35 |
||||
|
**/ |
||||
|
@AllArgsConstructor |
||||
|
@Getter |
||||
|
@NoArgsConstructor |
||||
|
public enum ProjectClientEnum { |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
RESI("resi", "居民端"), |
||||
|
GOV("gov", "工作端"), |
||||
|
OPER("oper", "运营端"), |
||||
|
NONE("none", "不限制") |
||||
|
; |
||||
|
|
||||
|
|
||||
|
@EnumValue |
||||
|
@JsonValue |
||||
|
private String code; |
||||
|
|
||||
|
private String desc; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 枚举入参注解 |
||||
|
* |
||||
|
* @param code |
||||
|
* @return |
||||
|
*/ |
||||
|
@JsonCreator |
||||
|
public static ProjectClientEnum getByCode(String code) { |
||||
|
for (ProjectClientEnum statusEnum : values()) { |
||||
|
if (statusEnum.getCode().equalsIgnoreCase(code)) { |
||||
|
return statusEnum; |
||||
|
} |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue