package com.ankaibei.workFlow.webadmin.ankaibei.enums;

public enum TaskPriority {

    NORMAL("1", "正常"),
    FIRST("2", "优先"),
    ;

    /**
     * 状态码
     */
    private final String code;
    /**
     * 信息
     */
    private final String reason;

    /**
     * 666666
     */
    TaskPriority(String code, String reason) {
        this.code = code;
        this.reason = reason;
    }

    public String getCode() {
        return code;
    }

    public String getReason() {
        return reason;
    }

    /**
     * 通过枚举的code,查询对应的枚举项
     *
     * @param code
     * @return
     */
    public static TaskPriority getEnumByCode(String code) {
        TaskPriority[] values = TaskPriority.values();
        for (TaskPriority statusEnums : values) {
            if (statusEnums.getCode().equals(code)) {
                return statusEnums;
            }
        }
        return null;
    }
}
