package com.gic.haoban.manage.api.enums;

import java.io.Serializable;

/**
 * desc：欢迎语媒体文件类型枚举类
 *
 * @author: YongEn
 * @date: 2022/2/9
 **/
public enum WelcomeMediaTypeEnum implements Serializable {
    /**
     * 图片
     */
    IMAGE(1, "图片"),
    VIDEO(2, "视频"),
    FILE(3, "文件"),
    LINK(4, "链接"),
    PROGRAM(5, "小程序"),
    PARAM_PROGRAM(6, "带参小程序"),
    PARAM_QRCODE(7, "带参公众号二维码"),
    ;

    private final Integer code;
    private final String desc;

    WelcomeMediaTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static String getDescByCode(Integer code){
        for (WelcomeMediaTypeEnum welcomeMediaTypeEnum : values()) {
            if (welcomeMediaTypeEnum.getCode().equals(code)){
                return welcomeMediaTypeEnum.getDesc();
            }
        }
        return "";
    }
}
