package fcb.project.manager.base.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * @author abnerhou
 * @date 2020/6/5 18:16
 * @desciption
 */
public enum TerminalType {
    CUSTOMER("customer" , "用户端"),
    AGENT("agent" , "经纪人端"),
    ;
    private String type;
    private String desc;

    TerminalType(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public  static TerminalType getByType(String type){
        if(StringUtils.isNoneBlank(type)){
            for (TerminalType terminalType : TerminalType.values()){
                if(StringUtils.equals(terminalType.getType() , type)){
                    return terminalType;
                }
            }
        }
        return null;
    }

    public String getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }
}
