package com.energy.manage.common.enums;

public enum DataSourceTypeEnum {

    TERRACE_SOURCE(1,"平台输入"),
    UPLOAD_SOURCE(2, "导入");

    DataSourceTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    private Integer code;
    private String name;


    public Integer getCode() {
        return code;
    }

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

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getKeyByValue(Integer code){
        for(DataSourceTypeEnum e : values()){
            if(code.equals(e.code)){
                return e.name;
            }
        }
        return "Not exist";
    }

    public static DataSourceTypeEnum getFastReplyType(Integer code){
        for(DataSourceTypeEnum e : values()){
            if(code.equals(e.code)){
                return e;
            }
        }
        return null;
    }
}
