package cn.com.ctop.alarm.modules.enums;

public enum StatusEnum {
    STATUSM1("-1", "不限"),
    STATUS1("1", "已暂停"),
    STATUS3("3", "超预算"),
    STATUS4("4", "有效"),
    STATUS5("5", "已删除"),
    STATUS6("6", "余额不足"),
    STATUS11("11", "审核中"),
    STATUS12("12", "审核未通过"),
    STATUS14("14", "已结束"),
    STATUS15("15", "已暂停"),
    STATUS17("17", "组超预算"),
    STATUS19("19", "未达投放时间"),
    STATUS20("20", "有效");

    private String name;
    private String code;

    private StatusEnum(String code, String name) {
        this.name = name;
        this.code = code;
    }

    public static StatusEnum getEnumByCode(String code) {
        for (StatusEnum em : StatusEnum.values()) {
            if (em.code.equals(code)) {
                return em;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public String getCode() {
        return code;
    }
}
