forked from dyf/fys-Multi-tenant
设备mqtt收发数据
This commit is contained in:
@ -1,9 +1,11 @@
|
||||
package com.fuyuanshen.app.controller;
|
||||
|
||||
import cn.hutool.json.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.fuyuanshen.app.domain.bo.AppPersonnelInfoBo;
|
||||
import com.fuyuanshen.app.domain.dto.APPReNameDTO;
|
||||
import com.fuyuanshen.app.domain.dto.AppDeviceLogoUploadDto;
|
||||
import com.fuyuanshen.app.domain.dto.DeviceInstructDto;
|
||||
import com.fuyuanshen.app.domain.vo.APPDeviceTypeVo;
|
||||
import com.fuyuanshen.app.domain.vo.AppDeviceDetailVo;
|
||||
import com.fuyuanshen.app.service.AppDeviceBizService;
|
||||
@ -23,6 +25,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* APP设备信息管理
|
||||
@ -129,7 +132,8 @@ public class AppDeviceController extends BaseController {
|
||||
* 0(关灯),1(强光模式),2(弱光模式), 3(爆闪模式), 4(泛光模式)
|
||||
*/
|
||||
@PostMapping("/lightModeSettings")
|
||||
public R<Void> lightModeSettings(@RequestBody JSONObject params) {
|
||||
public R<Void> lightModeSettings(@RequestBody DeviceInstructDto params) {
|
||||
// params 转 JSONObject
|
||||
appDeviceService.lightModeSettings(params);
|
||||
return R.ok();
|
||||
}
|
||||
@ -139,7 +143,7 @@ public class AppDeviceController extends BaseController {
|
||||
*
|
||||
*/
|
||||
@PostMapping("/lightBrightnessSettings")
|
||||
public R<Void> lightBrightnessSettings(@RequestBody JSONObject params) {
|
||||
public R<Void> lightBrightnessSettings(@RequestBody DeviceInstructDto params) {
|
||||
appDeviceService.lightBrightnessSettings(params);
|
||||
return R.ok();
|
||||
}
|
||||
@ -149,7 +153,7 @@ public class AppDeviceController extends BaseController {
|
||||
*
|
||||
*/
|
||||
@PostMapping("/laserModeSettings")
|
||||
public R<Void> laserModeSettings(@RequestBody JSONObject params) {
|
||||
public R<Void> laserModeSettings(@RequestBody DeviceInstructDto params) {
|
||||
appDeviceService.laserModeSettings(params);
|
||||
return R.ok();
|
||||
}
|
||||
@ -159,7 +163,7 @@ public class AppDeviceController extends BaseController {
|
||||
*
|
||||
*/
|
||||
@PostMapping("/mapReverseGeocoding")
|
||||
public R<Void> mapReverseGeocoding(@RequestBody JSONObject params) {
|
||||
public R<Void> mapReverseGeocoding(@RequestBody DeviceInstructDto params) {
|
||||
String mapJson = appDeviceService.mapReverseGeocoding(params);
|
||||
return R.ok(mapJson);
|
||||
}
|
||||
|
@ -0,0 +1,16 @@
|
||||
package com.fuyuanshen.app.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DeviceInstructDto {
|
||||
|
||||
private Long deviceId;
|
||||
|
||||
private String deviceImei;
|
||||
/**
|
||||
* 下发指令
|
||||
*/
|
||||
private Object instructValue;
|
||||
|
||||
}
|
@ -10,6 +10,7 @@ import com.fuyuanshen.app.domain.AppPersonnelInfo;
|
||||
import com.fuyuanshen.app.domain.bo.AppPersonnelInfoBo;
|
||||
import com.fuyuanshen.app.domain.dto.APPReNameDTO;
|
||||
import com.fuyuanshen.app.domain.dto.AppDeviceLogoUploadDto;
|
||||
import com.fuyuanshen.app.domain.dto.DeviceInstructDto;
|
||||
import com.fuyuanshen.app.domain.vo.APPDeviceTypeVo;
|
||||
import com.fuyuanshen.app.domain.vo.AppDeviceBindRecordVo;
|
||||
import com.fuyuanshen.app.domain.vo.AppDeviceDetailVo;
|
||||
@ -17,7 +18,6 @@ import com.fuyuanshen.app.domain.vo.AppPersonnelInfoVo;
|
||||
import com.fuyuanshen.app.mapper.AppDeviceBindRecordMapper;
|
||||
import com.fuyuanshen.app.mapper.AppPersonnelInfoMapper;
|
||||
import com.fuyuanshen.app.mapper.equipment.APPDeviceMapper;
|
||||
import com.fuyuanshen.common.core.domain.R;
|
||||
import com.fuyuanshen.common.core.exception.ServiceException;
|
||||
import com.fuyuanshen.common.core.utils.ImageToCArrayConverter;
|
||||
import com.fuyuanshen.common.core.utils.MapstructUtils;
|
||||
@ -384,14 +384,14 @@ public class AppDeviceBizService {
|
||||
* 灯光模式
|
||||
* 0(关灯),1(强光模式),2(弱光模式), 3(爆闪模式), 4(泛光模式)
|
||||
*/
|
||||
public void lightModeSettings(JSONObject params) {
|
||||
public void lightModeSettings(DeviceInstructDto params) {
|
||||
try {
|
||||
Long deviceId = params.getLong("deviceId");
|
||||
Long deviceId = params.getDeviceId();
|
||||
Device device = deviceMapper.selectById(deviceId);
|
||||
if(device == null){
|
||||
throw new ServiceException("设备不存在");
|
||||
}
|
||||
Integer instructValue = params.getInteger("instructValue");
|
||||
Integer instructValue = (Integer) params.getInstructValue();
|
||||
ArrayList<Integer> intData = new ArrayList<>();
|
||||
intData.add(1);
|
||||
intData.add(instructValue);
|
||||
@ -408,14 +408,14 @@ public class AppDeviceBizService {
|
||||
}
|
||||
|
||||
//灯光亮度设置
|
||||
public void lightBrightnessSettings(JSONObject params) {
|
||||
public void lightBrightnessSettings(DeviceInstructDto params) {
|
||||
try {
|
||||
Long deviceId = params.getLong("deviceId");
|
||||
Long deviceId = params.getDeviceId();
|
||||
Device device = deviceMapper.selectById(deviceId);
|
||||
if(device == null){
|
||||
throw new ServiceException("设备不存在");
|
||||
}
|
||||
String instructValue = params.getString("instructValue");
|
||||
String instructValue = (String)params.getInstructValue();
|
||||
ArrayList<Integer> intData = new ArrayList<>();
|
||||
intData.add(5);
|
||||
String[] values = instructValue.split("\\.");
|
||||
@ -440,14 +440,14 @@ public class AppDeviceBizService {
|
||||
}
|
||||
|
||||
//激光模式设置
|
||||
public void laserModeSettings(JSONObject params) {
|
||||
public void laserModeSettings(DeviceInstructDto params) {
|
||||
try {
|
||||
Long deviceId = params.getLong("deviceId");
|
||||
Long deviceId = params.getDeviceId();
|
||||
Device device = deviceMapper.selectById(deviceId);
|
||||
if(device == null){
|
||||
throw new ServiceException("设备不存在");
|
||||
}
|
||||
Integer instructValue = params.getInteger("instructValue");
|
||||
Integer instructValue = (Integer) params.getInstructValue();
|
||||
ArrayList<Integer> intData = new ArrayList<>();
|
||||
intData.add(4);
|
||||
intData.add(instructValue);
|
||||
@ -463,12 +463,15 @@ public class AppDeviceBizService {
|
||||
}
|
||||
}
|
||||
|
||||
public String mapReverseGeocoding(JSONObject params) {
|
||||
Long deviceId = params.getLong("deviceId");
|
||||
Device device = deviceMapper.selectById(deviceId);
|
||||
if(device == null){
|
||||
public String mapReverseGeocoding(DeviceInstructDto params) {
|
||||
// Long deviceId = params.getDeviceId();
|
||||
// Device device = deviceMapper.selectById(deviceId);
|
||||
QueryWrapper<Device> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("device_imei", params.getDeviceImei());
|
||||
List<Device> devices = deviceMapper.selectList(queryWrapper);
|
||||
if(ObjectUtils.length( devices) ==0){
|
||||
throw new ServiceException("设备不存在");
|
||||
}
|
||||
return RedisUtils.getCacheObject("device:location:" + device.getDeviceImei());
|
||||
return RedisUtils.getCacheObject("device:location:" + devices.get(0).getDeviceImei());
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ public interface MqttMessageRule {
|
||||
* 获取命令类型
|
||||
* @return 命令类型
|
||||
*/
|
||||
Integer getCommandType();
|
||||
String getCommandType();
|
||||
/**
|
||||
* 执行处理
|
||||
* @param context 处理上下文
|
||||
|
@ -13,11 +13,12 @@ import java.util.List;
|
||||
public class MqttRuleEngine {
|
||||
|
||||
|
||||
private final LinkedHashMap<Integer, MqttMessageRule> rulesMap = new LinkedHashMap<>();
|
||||
private final LinkedHashMap<String, MqttMessageRule> rulesMap = new LinkedHashMap<>();
|
||||
public MqttRuleEngine(List<MqttMessageRule> rules) {
|
||||
// 按优先级排序
|
||||
rules.sort(Comparator.comparing(MqttMessageRule::getPriority));
|
||||
rules.forEach(rule -> rulesMap.put(rule.getCommandType(), rule));
|
||||
rules.forEach(rule -> rulesMap.put(rule.getCommandType(), rule)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -27,7 +28,7 @@ public class MqttRuleEngine {
|
||||
*/
|
||||
public boolean executeRule(MqttRuleContext context) {
|
||||
int commandType = context.getCommandType();
|
||||
MqttMessageRule mqttMessageRule = rulesMap.get(commandType);
|
||||
MqttMessageRule mqttMessageRule = rulesMap.get("Light_"+commandType);
|
||||
if (mqttMessageRule != null) {
|
||||
mqttMessageRule.execute(context);
|
||||
return true;
|
||||
|
@ -1,78 +0,0 @@
|
||||
package com.fuyuanshen.global.mqtt.constants;
|
||||
|
||||
/**
|
||||
* 设备命令类型常量
|
||||
* Device Command Type Constants
|
||||
*/
|
||||
public class DeviceCommandTypeConstants {
|
||||
|
||||
/**
|
||||
* 灯光模式 (Light Mode)
|
||||
*/
|
||||
public static final int LIGHT_MODE = 1;
|
||||
|
||||
/**
|
||||
* 人员信息 (Personnel Information)
|
||||
*/
|
||||
public static final int PERSONNEL_INFO = 2;
|
||||
|
||||
/**
|
||||
* 开机LOGO (Boot Logo)
|
||||
*/
|
||||
public static final int BOOT_LOGO = 3;
|
||||
|
||||
/**
|
||||
* 激光灯 (Laser Light)
|
||||
*/
|
||||
public static final int LASER_LIGHT = 4;
|
||||
|
||||
/**
|
||||
* 主灯亮度 (Main Light Brightness)
|
||||
*/
|
||||
public static final int MAIN_LIGHT_BRIGHTNESS = 5;
|
||||
|
||||
/**
|
||||
* 定位数据 (Location Data)
|
||||
*/
|
||||
public static final int LOCATION_DATA = 11;
|
||||
|
||||
/**
|
||||
* 获取命令类型描述
|
||||
*
|
||||
* @param commandType 命令类型
|
||||
* @return 命令类型描述
|
||||
*/
|
||||
public static String getCommandTypeDescription(int commandType) {
|
||||
switch (commandType) {
|
||||
case LIGHT_MODE:
|
||||
return "灯光模式 (Light Mode)";
|
||||
case PERSONNEL_INFO:
|
||||
return "人员信息 (Personnel Information)";
|
||||
case BOOT_LOGO:
|
||||
return "开机LOGO (Boot Logo)";
|
||||
case LASER_LIGHT:
|
||||
return "激光灯 (Laser Light)";
|
||||
case MAIN_LIGHT_BRIGHTNESS:
|
||||
return "主灯亮度 (Main Light Brightness)";
|
||||
case LOCATION_DATA:
|
||||
return "定位数据 (Location Data)";
|
||||
default:
|
||||
return "未知命令类型 (Unknown Command Type)";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否为有效命令类型
|
||||
*
|
||||
* @param commandType 命令类型
|
||||
* @return 是否有效
|
||||
*/
|
||||
public static boolean isValidCommandType(int commandType) {
|
||||
return commandType == LIGHT_MODE ||
|
||||
commandType == PERSONNEL_INFO ||
|
||||
commandType == BOOT_LOGO ||
|
||||
commandType == LASER_LIGHT ||
|
||||
commandType == MAIN_LIGHT_BRIGHTNESS ||
|
||||
commandType == LOCATION_DATA;
|
||||
}
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package com.fuyuanshen.global.mqtt.constants;
|
||||
|
||||
/**
|
||||
* 设备命令类型常量
|
||||
* Device Command Type Constants
|
||||
*/
|
||||
public class LightingCommandTypeConstants {
|
||||
|
||||
/**
|
||||
* 灯光模式 (Light Mode)
|
||||
*/
|
||||
public static final String LIGHT_MODE = "Light_1";
|
||||
|
||||
/**
|
||||
* 人员信息 (Personnel Information)
|
||||
*/
|
||||
public static final String PERSONNEL_INFO = "Light_2";
|
||||
|
||||
/**
|
||||
* 开机LOGO (Boot Logo)
|
||||
*/
|
||||
public static final String BOOT_LOGO = "Light_3";
|
||||
|
||||
/**
|
||||
* 激光灯 (Laser Light)
|
||||
*/
|
||||
public static final String LASER_LIGHT = "Light_4";
|
||||
|
||||
/**
|
||||
* 主灯亮度 (Main Light Brightness)
|
||||
*/
|
||||
public static final String MAIN_LIGHT_BRIGHTNESS = "Light_5";
|
||||
|
||||
/**
|
||||
* 定位数据 (Location Data)
|
||||
*/
|
||||
public static final String LOCATION_DATA = "Light_11";
|
||||
|
||||
/**
|
||||
* 主动上报设备数据 (Active Reporting Device Data)
|
||||
*/
|
||||
public static final String ACTIVE_REPORTING_DEVICE_DATA = "Light_12";
|
||||
|
||||
/**
|
||||
* 获取命令类型描述
|
||||
*
|
||||
* @param commandType 命令类型
|
||||
* @return 命令类型描述
|
||||
*/
|
||||
public static String getCommandTypeDescription(String commandType) {
|
||||
return switch (commandType) {
|
||||
case LIGHT_MODE -> "灯光模式 (Light Mode)";
|
||||
case PERSONNEL_INFO -> "人员信息 (Personnel Information)";
|
||||
case BOOT_LOGO -> "开机LOGO (Boot Logo)";
|
||||
case LASER_LIGHT -> "激光灯 (Laser Light)";
|
||||
case MAIN_LIGHT_BRIGHTNESS -> "主灯亮度 (Main Light Brightness)";
|
||||
case LOCATION_DATA -> "定位数据 (Location Data)";
|
||||
default -> "未知命令类型 (Unknown Command Type)";
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否为有效命令类型
|
||||
*
|
||||
* @param commandType 命令类型
|
||||
* @return 是否有效
|
||||
*/
|
||||
public static boolean isValidCommandType(String commandType) {
|
||||
return commandType.equals(LIGHT_MODE) ||
|
||||
commandType.equals(PERSONNEL_INFO) ||
|
||||
commandType.equals(BOOT_LOGO) ||
|
||||
commandType.equals(LASER_LIGHT) ||
|
||||
commandType.equals(MAIN_LIGHT_BRIGHTNESS) ||
|
||||
commandType.equals(LOCATION_DATA);
|
||||
}
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package com.fuyuanshen.global.mqtt.rule;
|
||||
|
||||
import com.fuyuanshen.common.json.utils.JsonUtils;
|
||||
import com.fuyuanshen.common.redis.utils.RedisUtils;
|
||||
import com.fuyuanshen.global.mqtt.base.MqttMessageRule;
|
||||
import com.fuyuanshen.global.mqtt.base.MqttRuleContext;
|
||||
import com.fuyuanshen.global.mqtt.config.MqttGateway;
|
||||
import com.fuyuanshen.global.mqtt.constants.LightingCommandTypeConstants;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
/**
|
||||
* 主动上报设备数据命令处理
|
||||
* "第1位为12表示设备主动上报设备硬件状态,第2为表示当时设备主灯档位,第3位表示当时激光灯档位,第4位电量百分比,第5位为充电状态(0没有充电,1正在充电,2为已充满)
|
||||
* 第6位200代表电池剩余续航时间200分钟"
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class ActiveReportingDeviceDataRule implements MqttMessageRule {
|
||||
|
||||
private final MqttGateway mqttGateway;
|
||||
|
||||
|
||||
@Override
|
||||
public String getCommandType() {
|
||||
return LightingCommandTypeConstants.ACTIVE_REPORTING_DEVICE_DATA;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MqttRuleContext context) {
|
||||
try {
|
||||
Object[] convertArr = context.getConvertArr();
|
||||
// Latitude, longitude
|
||||
//主灯档位,激光灯档位,电量百分比,充电状态,电池剩余续航时间
|
||||
String mainLightMode = convertArr[1].toString();
|
||||
String laserLightMode = convertArr[2].toString();
|
||||
String batteryPercentage = convertArr[3].toString();
|
||||
String chargeState = convertArr[4].toString();
|
||||
String batteryRemainingTime = convertArr[5].toString();
|
||||
|
||||
// 异步发送设备状态和位置信息到Redis
|
||||
asyncSendDeviceDataToRedisWithFuture(context.getDeviceImei(), mainLightMode, laserLightMode,
|
||||
batteryPercentage, chargeState, batteryRemainingTime);
|
||||
} catch (Exception e) {
|
||||
log.error("处理定位数据命令时出错", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步发送设备状态信息和位置信息到Redis(使用CompletableFuture)
|
||||
*
|
||||
* @param deviceImei 设备IMEI
|
||||
* @param mainLightMode 主灯档位
|
||||
* @param laserLightMode 激光灯档位
|
||||
* @param batteryPercentage 电量百分比
|
||||
* @param chargeState 充电状态
|
||||
* @param batteryRemainingTime 电池剩余续航时间
|
||||
*/
|
||||
public void asyncSendDeviceDataToRedisWithFuture(String deviceImei, String mainLightMode, String laserLightMode,
|
||||
String batteryPercentage, String chargeState, String batteryRemainingTime) {
|
||||
CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
// 构造设备状态信息对象
|
||||
Map<String, Object> deviceInfo = new LinkedHashMap<>();
|
||||
deviceInfo.put("deviceImei", deviceImei);
|
||||
deviceInfo.put("mainLightMode", mainLightMode);
|
||||
deviceInfo.put("laserLightMode", laserLightMode);
|
||||
deviceInfo.put("batteryPercentage", batteryPercentage);
|
||||
deviceInfo.put("chargeState", chargeState);
|
||||
deviceInfo.put("batteryRemainingTime", batteryRemainingTime);
|
||||
deviceInfo.put("timestamp", System.currentTimeMillis());
|
||||
|
||||
// 将设备状态信息存储到Redis中
|
||||
String deviceRedisKey = "device:status:" + deviceImei;
|
||||
String deviceInfoJson = JsonUtils.toJsonString(deviceInfo);
|
||||
|
||||
// 存储到Redis,设置过期时间(例如24小时)
|
||||
RedisUtils.setCacheObject(deviceRedisKey, deviceInfoJson, Duration.ofSeconds(24 * 60 * 60));
|
||||
|
||||
log.info("设备状态信息已异步发送到Redis: device={}, mainLightMode={}, laserLightMode={}, batteryPercentage={}",
|
||||
deviceImei, mainLightMode, laserLightMode, batteryPercentage);
|
||||
} catch (Exception e) {
|
||||
log.error("异步发送设备信息到Redis时出错: device={}, error={}", deviceImei, e.getMessage(), e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -1,12 +1,14 @@
|
||||
package com.fuyuanshen.global.mqtt.rule;
|
||||
|
||||
import com.fuyuanshen.common.core.utils.StringUtils;
|
||||
import com.fuyuanshen.common.json.utils.JsonUtils;
|
||||
import com.fuyuanshen.common.redis.utils.RedisUtils;
|
||||
import com.fuyuanshen.equipment.utils.c.map.GetAddressFromLatUtil;
|
||||
import com.fuyuanshen.equipment.utils.c.map.LngLonUtil;
|
||||
import com.fuyuanshen.global.mqtt.base.MqttMessageRule;
|
||||
import com.fuyuanshen.global.mqtt.base.MqttRuleContext;
|
||||
import com.fuyuanshen.global.mqtt.config.MqttGateway;
|
||||
import com.fuyuanshen.global.mqtt.constants.DeviceCommandTypeConstants;
|
||||
import com.fuyuanshen.global.mqtt.constants.LightingCommandTypeConstants;
|
||||
import com.fuyuanshen.global.mqtt.constants.MqttConstants;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -31,8 +33,8 @@ public class LocationDataRule implements MqttMessageRule {
|
||||
|
||||
|
||||
@Override
|
||||
public Integer getCommandType() {
|
||||
return DeviceCommandTypeConstants.LOCATION_DATA;
|
||||
public String getCommandType() {
|
||||
return LightingCommandTypeConstants.LOCATION_DATA;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -101,12 +103,16 @@ public class LocationDataRule implements MqttMessageRule {
|
||||
public void asyncSendLocationToRedisWithFuture(String deviceImei, String latitude, String longitude) {
|
||||
CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
if(StringUtils.isNotBlank(latitude) || StringUtils.isNotBlank(longitude)){
|
||||
return;
|
||||
}
|
||||
// 构造位置信息对象
|
||||
Map<String, Object> locationInfo = new LinkedHashMap<>();
|
||||
double[] doubles = LngLonUtil.gps84_To_Gcj02(Double.parseDouble(latitude), Double.parseDouble(longitude));
|
||||
locationInfo.put("deviceImei", deviceImei);
|
||||
locationInfo.put("latitude", latitude);
|
||||
locationInfo.put("longitude", longitude);
|
||||
String address = GetAddressFromLatUtil.getAdd(longitude, latitude);
|
||||
locationInfo.put("latitude", doubles[0]);
|
||||
locationInfo.put("longitude", doubles[1]);
|
||||
String address = GetAddressFromLatUtil.getAdd(String.valueOf(doubles[1]), String.valueOf(doubles[0]));
|
||||
locationInfo.put("address", address);
|
||||
locationInfo.put("timestamp", System.currentTimeMillis());
|
||||
|
||||
@ -130,7 +136,7 @@ public class LocationDataRule implements MqttMessageRule {
|
||||
String[] lonArr = longitude.split("\\.");
|
||||
|
||||
ArrayList<Integer> intData = new ArrayList<>();
|
||||
intData.add(DeviceCommandTypeConstants.LOCATION_DATA);
|
||||
intData.add(11);
|
||||
intData.add(Integer.parseInt(latArr[0]));
|
||||
intData.add(Integer.parseInt(latArr[1]));
|
||||
intData.add(Integer.parseInt(lonArr[0]));
|
||||
|
@ -7,7 +7,7 @@ import com.fuyuanshen.common.redis.utils.RedisUtils;
|
||||
import com.fuyuanshen.global.mqtt.base.MqttMessageRule;
|
||||
import com.fuyuanshen.global.mqtt.base.MqttRuleContext;
|
||||
import com.fuyuanshen.global.mqtt.config.MqttGateway;
|
||||
import com.fuyuanshen.global.mqtt.constants.DeviceCommandTypeConstants;
|
||||
import com.fuyuanshen.global.mqtt.constants.LightingCommandTypeConstants;
|
||||
import com.fuyuanshen.global.mqtt.constants.MqttConstants;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -31,8 +31,8 @@ public class PersonnelInfoRule implements MqttMessageRule {
|
||||
private final MqttGateway mqttGateway;
|
||||
|
||||
@Override
|
||||
public Integer getCommandType() {
|
||||
return DeviceCommandTypeConstants.PERSONNEL_INFO;
|
||||
public String getCommandType() {
|
||||
return LightingCommandTypeConstants.PERSONNEL_INFO;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -201,7 +201,7 @@ springdoc:
|
||||
in: HEADER
|
||||
name: ${sa-token.token-name}
|
||||
#这里定义了两个分组,可定义多个,也可以不定义
|
||||
group-configs:
|
||||
s:
|
||||
- group: 1.演示模块
|
||||
packages-to-scan: com.fuyuanshen.demo
|
||||
- group: 2.通用模块
|
||||
|
Reference in New Issue
Block a user