package cn.axzo.msg.center.api.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

import java.util.Arrays;

@Getter
public enum MsgRecordTerminalTypeEnum {
  ENT(2, "企业"),
  PROJECT(1, "项目"),
  UNKNOWN(0, "未知"),
  ;

  @EnumValue
  private final Integer code;
  private final String message;

  MsgRecordTerminalTypeEnum(Integer code, String message) {
    this.code = code;
    this.message = message;
  }

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

  public String getMessage() {
    return this.message;
  }

  public static MsgRecordTerminalTypeEnum getValue(Integer code) {
    return Arrays.stream(values()).filter(it -> it.code.equals(code)).findFirst()
        .orElse(null);
  }
}
