Commit d9dda54ccedb9dbf9ea13dc1190f95a136f55db5
1 parent
8a7e1464
local
Showing
4 changed files
with
86 additions
and
11 deletions
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/tdengine/IotDeviceLogDataMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.iot.dal.tdengine; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.module.iot.dal.dataobject.device.IotDeviceLogDO; | ||
| 4 | +import cn.iocoder.yudao.module.iot.framework.tdengine.core.annotation.TDengineDS; | ||
| 5 | +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; | ||
| 6 | +import org.apache.ibatis.annotations.Mapper; | ||
| 7 | +import org.apache.ibatis.annotations.Param; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * IoT 设备日志 Mapper | ||
| 11 | + * | ||
| 12 | + * @author alwayssuper | ||
| 13 | + */ | ||
| 14 | +@Mapper | ||
| 15 | +@TDengineDS | ||
| 16 | +@InterceptorIgnore(tenantLine = "true") // 避免 SQL 解析,因为 JSqlParser 对 TDengine 的 SQL 解析会报错 | ||
| 17 | +public interface IotDeviceLogDataMapper { | ||
| 18 | + | ||
| 19 | + /** | ||
| 20 | + * 创建设备日志超级表 | ||
| 21 | + * 初始化只创建一次 | ||
| 22 | + */ | ||
| 23 | + void createDeviceLogSTable(); | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * 创建设备日志子表 | ||
| 27 | + * | ||
| 28 | + * @param deviceKey 设备标识 | ||
| 29 | + */ | ||
| 30 | + void createDeviceLogTable( @Param("deviceKey") String deviceKey); | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * 插入设备日志数据 | ||
| 34 | + * | ||
| 35 | + * @param log 设备日志数据 | ||
| 36 | + */ | ||
| 37 | + void insert(@Param("log") IotDeviceLogDO log); | ||
| 38 | + | ||
| 39 | +} |
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/device/IotDeviceLogDataService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.iot.service.device; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.module.iot.controller.admin.device.vo.deviceData.IotDeviceDataSimulatorSaveReqVO; | ||
| 4 | + | ||
| 5 | +/** | ||
| 6 | + * IoT 设备日志数据 Service 接口 | ||
| 7 | + * | ||
| 8 | + * @author alwayssuper | ||
| 9 | + */ | ||
| 10 | +public interface IotDeviceLogDataService { | ||
| 11 | + | ||
| 12 | + /** | ||
| 13 | + * 初始化 TDengine 表 | ||
| 14 | + */ | ||
| 15 | + void initTDengineSTable(); | ||
| 16 | + | ||
| 17 | + /** | ||
| 18 | + * 模拟设备创建设备日志 | ||
| 19 | + * @param simulatorReqVO 模拟设备信息 | ||
| 20 | + */ | ||
| 21 | + void createDeviceLog(IotDeviceDataSimulatorSaveReqVO simulatorReqVO); | ||
| 22 | +} |
yudao-server/src/main/resources/application-local.yaml
| @@ -45,7 +45,7 @@ spring: | @@ -45,7 +45,7 @@ spring: | ||
| 45 | primary: master | 45 | primary: master |
| 46 | datasource: | 46 | datasource: |
| 47 | master: | 47 | master: |
| 48 | - url: jdbc:mysql://127.0.0.1:3307/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 | 48 | + url: jdbc:mysql://chaojiniu.top:23306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 |
| 49 | # url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai # MySQL Connector/J 5.X 连接的示例 | 49 | # url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai # MySQL Connector/J 5.X 连接的示例 |
| 50 | # url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例 | 50 | # url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例 |
| 51 | # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 | 51 | # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 |
| @@ -53,8 +53,8 @@ spring: | @@ -53,8 +53,8 @@ spring: | ||
| 53 | # url: jdbc:dm://127.0.0.1:5236?schema=RUOYI_VUE_PRO # DM 连接的示例 | 53 | # url: jdbc:dm://127.0.0.1:5236?schema=RUOYI_VUE_PRO # DM 连接的示例 |
| 54 | # url: jdbc:kingbase8://127.0.0.1:54321/test # 人大金仓 KingbaseES 连接的示例 | 54 | # url: jdbc:kingbase8://127.0.0.1:54321/test # 人大金仓 KingbaseES 连接的示例 |
| 55 | # url: jdbc:postgresql://127.0.0.1:5432/postgres # OpenGauss 连接的示例 | 55 | # url: jdbc:postgresql://127.0.0.1:5432/postgres # OpenGauss 连接的示例 |
| 56 | - username: root | ||
| 57 | - password: ahh@123456 | 56 | + username: ruoyi-vue-pro |
| 57 | + password: ruoyi-@h2ju02hebp | ||
| 58 | # username: sa # SQL Server 连接的示例 | 58 | # username: sa # SQL Server 连接的示例 |
| 59 | # password: Yudao@2024 # SQL Server 连接的示例 | 59 | # password: Yudao@2024 # SQL Server 连接的示例 |
| 60 | # username: SYSDBA # DM 连接的示例 | 60 | # username: SYSDBA # DM 连接的示例 |
| @@ -63,17 +63,25 @@ spring: | @@ -63,17 +63,25 @@ spring: | ||
| 63 | # password: Yudao@2024 # OpenGauss 连接的示例 | 63 | # password: Yudao@2024 # OpenGauss 连接的示例 |
| 64 | slave: # 模拟从库,可根据自己需要修改 | 64 | slave: # 模拟从库,可根据自己需要修改 |
| 65 | lazy: true # 开启懒加载,保证启动速度 | 65 | lazy: true # 开启懒加载,保证启动速度 |
| 66 | - url: jdbc:mysql://127.0.0.1:3307/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true | 66 | + url: jdbc:mysql://chaojiniu.top:23306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true |
| 67 | + username: ruoyi-vue-pro | ||
| 68 | + password: ruoyi-@h2ju02hebp | ||
| 69 | + tdengine: # IOT 数据库 | ||
| 70 | +# lazy: true # 开启懒加载,保证启动速度 | ||
| 71 | + url: jdbc:TAOS-RS://chaojiniu.top:6041/ruoyi_vue_pro | ||
| 72 | + driver-class-name: com.taosdata.jdbc.rs.RestfulDriver | ||
| 67 | username: root | 73 | username: root |
| 68 | - password: ahh@123456 | 74 | + password: taosdata |
| 75 | + druid: | ||
| 76 | + validation-query: SELECT SERVER_STATUS() # TDengine 数据源的有效性检查 SQL | ||
| 69 | 77 | ||
| 70 | # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 | 78 | # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 |
| 71 | data: | 79 | data: |
| 72 | redis: | 80 | redis: |
| 73 | - host: 127.0.0.1 # 地址 | 81 | + host: chaojiniu.top # 地址 |
| 74 | port: 6379 # 端口 | 82 | port: 6379 # 端口 |
| 75 | - database: 0 # 数据库索引 | ||
| 76 | -# password: dev # 密码,建议生产环境开启 | 83 | + database: 15 # 数据库索引 |
| 84 | + password: fsknKD7UvQYZsyf2hXXn # 密码,建议生产环境开启 | ||
| 77 | 85 | ||
| 78 | --- #################### 定时任务相关配置 #################### | 86 | --- #################### 定时任务相关配置 #################### |
| 79 | 87 | ||
| @@ -175,8 +183,10 @@ logging: | @@ -175,8 +183,10 @@ logging: | ||
| 175 | cn.iocoder.yudao.module.crm.dal.mysql: debug | 183 | cn.iocoder.yudao.module.crm.dal.mysql: debug |
| 176 | cn.iocoder.yudao.module.erp.dal.mysql: debug | 184 | cn.iocoder.yudao.module.erp.dal.mysql: debug |
| 177 | cn.iocoder.yudao.module.iot.dal.mysql: debug | 185 | cn.iocoder.yudao.module.iot.dal.mysql: debug |
| 186 | + cn.iocoder.yudao.module.iot.dal.tdengine: DEBUG | ||
| 178 | cn.iocoder.yudao.module.ai.dal.mysql: debug | 187 | cn.iocoder.yudao.module.ai.dal.mysql: debug |
| 179 | org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # TODO 芋艿:先禁用,Spring Boot 3.X 存在部分错误的 WARN 提示 | 188 | org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # TODO 芋艿:先禁用,Spring Boot 3.X 存在部分错误的 WARN 提示 |
| 189 | + com.taosdata: DEBUG # TDengine 的日志级别 | ||
| 180 | 190 | ||
| 181 | debug: false | 191 | debug: false |
| 182 | 192 | ||
| @@ -259,7 +269,7 @@ justauth: | @@ -259,7 +269,7 @@ justauth: | ||
| 259 | iot: | 269 | iot: |
| 260 | emq: | 270 | emq: |
| 261 | # 账号 | 271 | # 账号 |
| 262 | - username: anhaohao | 272 | + username: haohao |
| 263 | # 密码 | 273 | # 密码 |
| 264 | password: ahh@123456 | 274 | password: ahh@123456 |
| 265 | # 主机地址 | 275 | # 主机地址 |
| @@ -271,4 +281,5 @@ iot: | @@ -271,4 +281,5 @@ iot: | ||
| 271 | # 保持连接 | 281 | # 保持连接 |
| 272 | keepalive: 60 | 282 | keepalive: 60 |
| 273 | # 清除会话(设置为false,断开连接,重连后使用原来的会话 保留订阅的主题,能接收离线期间的消息) | 283 | # 清除会话(设置为false,断开连接,重连后使用原来的会话 保留订阅的主题,能接收离线期间的消息) |
| 274 | - clearSession: true | ||
| 275 | \ No newline at end of file | 284 | \ No newline at end of file |
| 285 | + clearSession: true | ||
| 286 | + |
yudao-server/src/main/resources/application.yaml
| @@ -328,4 +328,7 @@ yudao: | @@ -328,4 +328,7 @@ yudao: | ||
| 328 | key: pLXUGAwK5305 | 328 | key: pLXUGAwK5305 |
| 329 | customer: E77DF18BE109F454A5CD319E44BF5177 | 329 | customer: E77DF18BE109F454A5CD319E44BF5177 |
| 330 | 330 | ||
| 331 | -debug: false | ||
| 332 | \ No newline at end of file | 331 | \ No newline at end of file |
| 332 | +debug: false | ||
| 333 | +# 插件配置 | ||
| 334 | +pf4j: | ||
| 335 | + pluginsDir: /Users/anhaohao/code/gitee/ruoyi-vue-pro/plugins # 插件目录 | ||
| 333 | \ No newline at end of file | 336 | \ No newline at end of file |