package com.sandu.ximon.admin.manager.iot.rrpc.enums;
|
|
import com.sandu.ximon.admin.dto.RemoteUpdateTypeDto;
|
|
import java.util.ArrayList;
|
import java.util.List;
|
import java.util.concurrent.ConcurrentHashMap;
|
|
/**
|
* @author ZZQ
|
* @date 2022/4/12 11:39
|
*/
|
public enum RemoteUpdateTypeEnum {
|
// MQTT主板
|
MQTT_MAIN("0"),
|
// MQTT核心板
|
MQTT_CORE("1"),
|
// 单灯模块
|
LIGHT("2"),
|
// C3充电桩模块
|
C3_CHARGING("3");
|
|
private String code;
|
|
public String getCode() {
|
return code;
|
}
|
|
|
RemoteUpdateTypeEnum(String code) {
|
this.code = code;
|
}
|
|
public static List<RemoteUpdateTypeDto> getAllType() {
|
|
List<RemoteUpdateTypeDto> list = new ArrayList<>();
|
for (RemoteUpdateTypeEnum r : RemoteUpdateTypeEnum.values()) {
|
RemoteUpdateTypeDto remoteUpdateTypeEntity = new RemoteUpdateTypeDto();
|
remoteUpdateTypeEntity.setVal(r.getCode());
|
remoteUpdateTypeEntity.setFileTypeName(map.get(r.getCode()));
|
list.add(remoteUpdateTypeEntity);
|
}
|
return list;
|
}
|
|
private static ConcurrentHashMap<String, String> map = new ConcurrentHashMap<String, String>() {
|
{
|
put("0", "MQTT核心板");
|
put("1", "Cat.1主板");
|
put("2", "C3充电桩模块");
|
put("3", "大气设备模块");
|
put("4", "杆体倾斜模块");
|
}
|
};
|
}
|