package jnpf.enums.cultivate;

import lombok.Getter;

/**
 * 合格分数类型（1固定分，2百分比）
 */
@Getter
public enum ApplyTypeEnum {
    GDF(1, "固定分"),
    BFB(2, "百分比");
    Integer code;
    String msg;

    ApplyTypeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public static String getMsg(Integer code) {
        ApplyTypeEnum[] values = ApplyTypeEnum.values();
        for (ApplyTypeEnum value : values) {
            if (value.getCode() == code) {
                return value.getMsg();
            }
        }
        return null;
    }

    public static ApplyTypeEnum getEnum(int code) {
        ApplyTypeEnum[] values = ApplyTypeEnum.values();
        for (ApplyTypeEnum value : values) {
            if (value.getCode() == code) {
                return value;
            }
        }
        return null;
    }
}
