package com.mvc.constant;

/**
 * 数据展示类型
 */
public enum DataViewType {
    NONE("0","无"),
    IMAGE_AND_DATA("1","图片+数据"),
    ONLY_IMAGE("2","图片"),
    ;

    private String flag;
    private String desc;

    DataViewType(String flag, String desc) {
        this.flag = flag;
        this.desc = desc;
    }

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static DataViewType findDataViewTypeByflag(String flag){
        for (DataViewType type: DataViewType.values()) {
            if (type.flag.equals(flag)) {
                return  type;
            }
        }
        return null;
    }
}
