若依微服务1.1.1版本:

1、tdengine服务获取设备在线接口修改
dev 1.1.1
xins 1 year ago
parent 0af59e14d2
commit d8601fc60f

File diff suppressed because it is too large Load Diff

@ -28,9 +28,10 @@ public class TdEngineConstants {
public static final String DEFAULT_TABLE_NAME_PREFIX = "t_device_";//数据表名称前缀
public static final String DEFAULT_DEVICE_STATUS_SUPER_TABLE_NAME_PREFIX = "st_ds";//设备状态超级表名称
public static final String DEFAULT_DEVICE_STATUS_SUPER_TABLE_NAME= "st_ds";//设备状态超级表名称
public static final String DEFAULT_DEVICE_STATUS_TABLE_NAME_PREFIX = "t_ds_";//设备状态数据表名称前缀
public static final String PLATFORM_DB_NAME = "db_hwsaas";//全局数据库名称
/**
* key
*/
@ -62,15 +63,5 @@ public class TdEngineConstants {
return DEFAULT_TABLE_NAME_PREFIX + deviceId;
}
/**
* @param: sceneId
* @return String
* @description
* @author xins
* @date 2023-09-05 9:42
*/
public static String getDeviceStatusSuperTableName(Long sceneId) {
return DEFAULT_DEVICE_STATUS_SUPER_TABLE_NAME_PREFIX + sceneId;
}
}

@ -1,22 +0,0 @@
package com.ruoyi;
import com.ruoyi.i18n.utils.MessageUtils;
// Press Shift twice to open the Search Everywhere dialog and type `show whitespaces`,
// then press Enter. You can now see whitespace characters in your code.
public class Main {
public static void main(String[] args) {
// Press Alt+Enter with your caret at the highlighted text to see how
// IntelliJ IDEA suggests fixing it.
System.out.printf("Hello and welcome!");
String dd = MessageUtils.getMessages("user.login.username");
System.out.println("dddd:"+dd);
// Press Shift+F10 or click the green arrow button in the gutter to run the code.
for (int i = 1; i <= 5; i++) {
// Press Shift+F9 to start debugging your code. We have set one breakpoint
// for you, but you can always add more by pressing Ctrl+F8.
System.out.println("i = " + i);
}
}
}

@ -1,22 +1,25 @@
# Tomcat
server:
port: 9206
port: 9604
# Spring
spring:
application:
# ????
# 应用名称
name: hw-mqtt-broker
profiles:
# ????
# 环境配置
active: dev
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 127.0.0.1:8848
config:
# ??????
server-addr: huawei-nacos:8848
# ??????
# 配置中心地址
server-addr: 127.0.0.1:8848
# 配置文件格式
file-extension: yml
# ????
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store

@ -10,6 +10,7 @@ import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Description:
* @ClassName: DeviceStatusServiceImpl
@ -24,20 +25,19 @@ public class DeviceStatusServiceImpl implements IDeviceStatusService {
private DeviceStatusMapper deviceStatusMapper;
/**
* @return List<DeviceStatus>
* @param: DeviceStatus
* @description 线
* @author xins
* @date 2023-09-05 13:23
* @return List<DeviceStatus>
*/
@Override
public List<DeviceStatus> getOnlineDevicesGroupByDay(DeviceStatus queryDeviceStatus) {
// Map<String, Object> params = new HashMap<>();
Map<String, Object> params = queryDeviceStatus.getParams();
params.put("databaseName", TdEngineConstants.PLATFORM_DB_NAME);
params.put("superTableName", TdEngineConstants.DEFAULT_DEVICE_STATUS_SUPER_TABLE_NAME);
// DeviceStatus queryDeviceStatus = new DeviceStatus();
// String databaseName = TdEngineConstants.getDatabaseName(sceneId);
// String superTableName = TdEngineConstants.getDeviceStatusSuperTableName(sceneId);
// params.put("databaseName", databaseName);
// params.put("superTableName", superTableName);
// params.put("beginTime", beginTime);
// params.put("endTime", endTime);
// queryDeviceStatus.setParams(params);

Loading…
Cancel
Save