package com.ynfy.buss.course.coursecatalog.enums;


/**
 * 课程目录类型
 */
public enum CatalogType {
    CATALOG(1, "目录"),
    TASK(2, "任务");

    private Integer code;

    private String value;

    CatalogType(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static CatalogType getByCode(Integer code) {
        for (CatalogType catalogType : values()) {
            if (catalogType.getCode().equals(code)) {
                return catalogType;
            }
        }
        return null;
    }

}
