package com.bonus.common.houqin.constant;

import lombok.Generated;

import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public enum DeviceTypeEnum {
   OTHER(0, "其他"),
   CAMERA(1, "摄像头"),
   SENSOR(2, "传感器"),
   DOOR(3, "门禁"),
   METER(4, "仪表"),
   INSTRUMENT(5, "仪器"),
   TEMPERATURE(6, "测温"),
   SAMPLECABINET(7, "留样柜"),
   POWER_SWITCH(8, "电源开关"),
   NVR(9, "硬盘录像机"),
   WATER_METER(10, "水表"),
   ELECTRIC_METER(11, "电表"),
   INDUSTRY_IOT_GATEWAY(12, "通信网关"),
   GAS_SENSOR(13, "气体检测仪"),
   TEMPERATURE_HUMIDITY_SENSOR(14, "温湿度传感器"),
   SMOKE_SENSOR(15, "烟雾检测传感器"),
   COOKING_DEVICE(16, "烹饪设备"),
   PROCESSING_DEVICE(17, "切配设备"),
   ULTRAVIOLET_LAMP_DEVICE(18, "紫外灯"),
   DISINFECTION_CABINET_DEVICE(19, "消毒柜"),
   CLEANING_DEVICE(20, "初加工设备"),
   SAMPLE_WEIGHT(21, "留样秤"),
   IMMERSION_SENSOR(22, "水浸检测传感器"),
   ELECTRIC_BREAKER(23, "断路器"),
   ELECTRIC_COLLECT(24, "采集器"),
   HAND_DISINFECT(25, "手部消毒机"),
   GRATING_DEVICE(30, "光栅"),
   SMART_WEIGHT_CONTAINER(31, "智能称重货架"),
   KITCHEN_WASTE(32, "智能厨余秤"),
   ADDITIVE_MANAGEMENT_CABINET(33, "添加剂管理柜"),
   BACK_DASHBOARD(34, "食安公示大屏"),
   GRATING_COLLECT_DEVICE(35, "光栅采集器"),
   DOOR_MAGNET(36, "门磁"),
   TASKS_BOARD(103, "任务看板"),
   TASKS_EXECUTE_TERMINAL(104, "任务执行终端");

   private final Integer key;
   private final String value;


   private DeviceTypeEnum(Integer key, String value) {
      this.key = key;
      this.value = value;
   }

   public static Map<Integer, String> toMap() {
      return Stream.of(DeviceTypeEnum.values())
              .collect(Collectors.toMap(
                      DeviceTypeEnum::getKey,
                      DeviceTypeEnum::getValue
              ));
   }

   public Integer getKey() {
      return this.key;
   }

   @Generated
   public String getValue() {
      return this.value;
   }
}
