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

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

public enum RoomTypeEnum {

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

    private String code;

    private String msg;

    RoomTypeEnum(String code, String msg) {
        this.code = code;
        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 code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

}
