package com.crm.activity.enums;

/**
 * 比赛类型
 *
 * @author y
 * @create 2022/1/9
 */
public enum ActivityRaceType {

    WEEKLY(1, "周赛"),
    MONTHLY(2, "月赛");

    //目标检测类样本、目标变化检测类样本、设施变化检测类样本 、其他


    private final Integer code;
    private final String desc;

    ActivityRaceType(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static ActivityRaceType matchCode(String code) {
        for (ActivityRaceType type : ActivityRaceType.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }

    public static String matchDesc(Integer code) {
        for (ActivityRaceType type : ActivityRaceType.values()) {
            if (type.getCode().equals(code)) {
                return type.getDesc();
            }
        }
        return null;
    }

}
