jinpengyong
2023-11-14 6dc6bdb333473740de399b99f9a18bb2ff7aae45
chore:新建重点任务分类提交
1 files added
54 ■■■■■ changed files
screen-api/src/main/java/com/moral/api/pojo/enums/EmphasisEnum.java 54 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/enums/EmphasisEnum.java
New file
@@ -0,0 +1,54 @@
package com.moral.api.pojo.enums;
import lombok.Getter;
import java.util.HashMap;
import java.util.Map;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.moral.api.exception.BusinessException;
@Getter
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum EmphasisEnum implements IntegerValueEnum {
    /**
     *立行整改
     */
    JZDLS(1, "建筑工地落实“六个百分百”"),
    /**
     *限期整改
     */
    JXHGK(2, "精细化管控"),
    ;
    @EnumValue
    public  final Integer value;
    public  final String name;
    EmphasisEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }
    private static Map<Integer, ChangeEnum> valueMap = new HashMap<>();
    static {
        for (ChangeEnum v : ChangeEnum.values()) {
            valueMap.put(v.value, v);
        }
    }
    @JsonCreator
    public static ChangeEnum getByValue(Integer value) {
        if (value == null) {
            return null;
        }
        ChangeEnum result = valueMap.get(value);
        if (result == null) {
            throw new BusinessException("枚举转换异常" + value);
        }
        return result;
    }
}