package com.yonge.cooleshow.biz.dal.enums.course;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.yonge.cooleshow.common.constant.SysConfigConstant;
import com.yonge.toolset.base.enums.BaseEnum;

/**
 * 课程类型
 * @author: Eric
 * @date: 2022-03-30
 */
public enum CourseTypeEnum implements BaseEnum<String, CourseTypeEnum> {

    PRACTICE("趣纠课"),
    LIVE("直播课"),
    PIANO_ROOM_CLASS("琴房课"),
    VIDEO("视频课"),
    VIP("VIP定制课"),
    ;
    @EnumValue
    private String code;
    private String msg;

    CourseTypeEnum(String msg) {
        this.code = this.name();
        this.msg = msg;
    }

    public String getMsg() {
        return this.msg;
    }

    public String getCode() {
        return code;
    }

    /**
     * 类型匹配
     * @param name 类型
     * @return boolean
     */
    public static boolean match(String name) {

        CourseTypeEnum[] values = CourseTypeEnum.values();
        for (CourseTypeEnum item : values) {

            if (item.name().equals(name)) {
                return true;
            }
        }

        return false;
    }
}
