fix: 微信小程序接口对接修改。

This commit is contained in:
tianyongbao
2026-01-12 00:33:59 +08:00
parent 2f740b74cd
commit 0387cc2f31
13 changed files with 531 additions and 25 deletions

View File

@@ -47,6 +47,13 @@ public class AliyunIotProperties {
*/
private String categoryKey;
/**
* 设备类型到产品Key的映射
* 1: 水质检测仪
* 2: 控制一体机
*/
private DeviceTypeMapping deviceType = new DeviceTypeMapping();
/**
* MQTT 配置(可选,用于设备直连)
*/
@@ -158,4 +165,39 @@ public class AliyunIotProperties {
private Integer reconnectDelay = 30000;
}
/**
* 设备类型映射配置
*/
@Data
public static class DeviceTypeMapping {
/**
* 水质检测仪 ProductKey
*/
private String waterQualityMonitor;
/**
* 控制一体机 ProductKey
*/
private String controlIntegrated;
/**
* 根据设备类型获取 ProductKey
* @param deviceType 1-水质检测仪, 2-控制一体机
* @return ProductKey
*/
public String getProductKeyByType(Integer deviceType) {
if (deviceType == null) {
return null;
}
switch (deviceType) {
case 1:
return waterQualityMonitor;
case 2:
return controlIntegrated;
default:
return null;
}
}
}
}