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


/**
 * 资源类型
 */
public enum ResourceType {
    VIDEO(1, "视频"),
    FILE(2, "文档");

    private Integer code;

    private String value;

    ResourceType(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 ResourceType getByCode(Integer code) {
        for (ResourceType resourceType : values()) {
            if (resourceType.getCode().equals(code)) {
                return resourceType;
            }
        }
        return null;
    }

}
