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

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public enum RoomTypeEnum {

    LIVE("直播课"),
    PRACTICE("陪练课"),
    TEMP("临时直播间");

    private final String code;

    private final String msg;

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

    /**
     * 校验code是否存在
     *
     * @param code code
     * @return true存在
     */
    public static boolean isExistCode(String code) {
        CourseScheduleEnum[] values = CourseScheduleEnum.values();
        List<String> collect = Arrays.stream(values).map(CourseScheduleEnum::getCode).collect(Collectors.toList());
        return collect.contains(code);
    }

    public String getCode() {
        return this.code;
    }

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

}
