package com.sjyt.icom.asst.common.enums;

import cn.hutool.core.util.ObjectUtil;
import com.sjyt.icom.asst.common.exception.CmdCategoryException;
import lombok.AllArgsConstructor;

/**
 * 房间枚举
 *
 * @author renyanru
 * @version V1.0.0
 * @date 2022/6/8 16:52
 */
@AllArgsConstructor
public enum RoomEnum {
  /** 一对一房间 */
  ONE2ONE("1"),
  /** 会议房间 */
  MEET("2");
  /** 多人房间 */

  public final String CODE;

  public static RoomEnum of(String code) {
    RoomEnum[] values = RoomEnum.values();
    for (RoomEnum value : values) {
      if (ObjectUtil.equals(code, value.CODE)) {
        return value;
      }
    }
    throw new CmdCategoryException("RoomEnum类型异常");
  }
}
