# PriorityEnum.java

    package cloud.wconnect.frontoffice.cons;

    import lombok.AllArgsConstructor;
    import lombok.Getter;

    import java.util.Objects;

    /**
     * 枚举：Priority
     *
     * @author yyt
     * 2023/3/20
     */
    @Getter
    @AllArgsConstructor
    public enum PriorityEnum {

        /**
         * Normal
         */
        NORMAL(0, "normal"),

        /**
         * Urgent
         */
        URGENT(1, "urgent"),

        /**
         * Critical
         */
        CRITICAL(2, "critical");

        private final int code;

        private final String info;

        public static String getInfoByCode(Integer code) {
            if (Objects.isNull(code)) {
                return "";
            }
            PriorityEnum[] priorityEnums = PriorityEnum.values();
            for (PriorityEnum priorityEnum : priorityEnums) {
                if (priorityEnum.getCode() == code) {
                    return priorityEnum.getInfo();
                }
            }
            return "";
        }
    }