package com.qiuguo.iot.base.enums;

/*
* 开放平台类型
* 作者：吴林
* */
// 0 语言模型 1：音乐 2 有声读物 3 天气 4 导航
public enum OpenTypeEnum {
    LANGUAGE_MODEL(0, "大语言模型"),
    MUSIC(1, "音乐"),
    SOUND(2, "有声读物"),
    WEATHER(3, "天气"),
    NAVIGATION(4, "导航"),
    ;
     OpenTypeEnum(Integer c, String n){
        code = c;
        name = n;
    }
    private Integer code;
    private String name;

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static OpenTypeEnum getEnumWithCode(Integer c){
        for (OpenTypeEnum e:values()
        ) {
            if(e.getCode().compareTo(c) == 0){
                return e;
            }
        }
        return null;
    }
    public static OpenTypeEnum getEnumWithName(String name){
        for (OpenTypeEnum e:values()
        ) {
            if(e.getName().equals(name)){
                return e;
            }
        }
        return null;
    }
}
