ソースを参照

代码重新生成、开发产品关联的功能,云函数、物模型、设备管理、用户

xucaiqin 2 年 前
コミット
ebe7c76afd
100 ファイル変更2005 行追加2694 行削除
  1. 8 0
      iot-framework/iot-common/pom.xml
  2. 0 9
      iot-framework/iot-common/src/main/java/com/middle/platform/common/constant/RequestConstant.java
  3. 8 0
      iot-framework/iot-common/src/main/java/com/middle/platform/common/constant/RpcConstants.java
  4. 51 0
      iot-framework/iot-common/src/main/java/com/middle/platform/common/utils/HashUtil.java
  5. 38 0
      iot-framework/iot-starter-biz-dict/pom.xml
  6. 18 0
      iot-framework/iot-starter-biz-dict/src/main/java/com/middle/platform/biz/dict/config/DictAutoConfiguration.java
  7. 11 0
      iot-framework/iot-starter-biz-dict/src/main/java/com/middle/platform/biz/dict/config/DictFeignAutoConfiguration.java
  8. 71 0
      iot-framework/iot-starter-biz-dict/src/main/java/com/middle/platform/biz/dict/core/util/DictFrameworkUtils.java
  9. 2 0
      iot-framework/iot-starter-biz-dict/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  10. 5 0
      iot-framework/iot-starter-feign/pom.xml
  11. 26 0
      iot-framework/iot-starter-feign/src/main/java/com/middle/platform/feign/core/FeignInterceptor.java
  12. 1 0
      iot-framework/iot-starter-feign/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  13. 0 5
      iot-framework/iot-starter-mybatis/src/main/java/com/middle/platform/mybatis/core/dataobject/BaseVO.java
  14. 3 1
      iot-framework/iot-starter-satoken/src/main/java/com/middle/platform/satoken/config/SaTokenConfig.java
  15. 25 0
      iot-framework/iot-starter-web/src/main/java/com/middle/platform/web/config/GlobalExceptionHandler.java
  16. 2 0
      iot-framework/pom.xml
  17. 4 0
      iot-gateway/pom.xml
  18. 1 1
      iot-module/iot-module-auth/iot-module-auth-api/src/main/java/com/middle/platform/auth/api/enums/ApiConstants.java
  19. 2 1
      iot-module/iot-module-auth/iot-module-auth-api/src/main/java/com/middle/platform/auth/api/feign/AuthApi.java
  20. 4 0
      iot-module/iot-module-auth/iot-module-auth-biz/pom.xml
  21. 16 0
      iot-module/iot-module-auth/iot-module-auth-biz/src/main/java/com/middle/platform/auth/biz/config/FeignConfig.java
  22. 45 3
      iot-module/iot-module-auth/iot-module-auth-biz/src/main/java/com/middle/platform/auth/biz/controller/AuthController.java
  23. 3 0
      iot-module/iot-module-auth/iot-module-auth-biz/src/main/java/com/middle/platform/auth/biz/pojo/LoginPara.java
  24. 61 0
      iot-module/iot-module-auth/iot-module-auth-biz/src/main/java/com/middle/platform/auth/biz/service/AuthService.java
  25. 0 16
      iot-module/iot-module-auth/iot-module-auth-biz/src/main/java/com/middle/platform/auth/biz/service/TestService.java
  26. 2 14
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/controller/IotCompanyController.java
  27. 29 22
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/controller/IotDeviceController.java
  28. 0 35
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/controller/IotModController.java
  29. 111 17
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/controller/IotProductController.java
  30. 0 18
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/controller/IotProjectController.java
  31. 0 18
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/controller/IotProjectDeviceController.java
  32. 0 35
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/controller/IotUrlController.java
  33. 0 45
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/IotCompany.java
  34. 0 103
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/IotDevice.java
  35. 0 50
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/IotMod.java
  36. 0 95
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/IotProduct.java
  37. 0 60
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/IotProject.java
  38. 0 53
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/IotProjectDevice.java
  39. 0 65
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/IotUrl.java
  40. 14 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/req/DevicePage.java
  41. 35 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/req/IotCloudPara.java
  42. 35 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/req/IotCloudTest.java
  43. 96 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/req/IotDevicePara.java
  44. 2 2
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/req/IotDeviceVo.java
  45. 27 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/req/IotModPara.java
  46. 76 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/req/IotProductPara.java
  47. 56 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/req/IotUrlPara.java
  48. 14 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/req/ProductPage.java
  49. 76 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/vo/IotProductVo.java
  50. 41 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/entity/IotCloud.java
  51. 35 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/entity/IotCompany.java
  52. 98 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/entity/IotDevice.java
  53. 35 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/entity/IotMod.java
  54. 94 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/entity/IotProduct.java
  55. 53 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/entity/IotProject.java
  56. 38 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/entity/IotProjectDevice.java
  57. 64 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/entity/IotUrl.java
  58. 13 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/mapper/IotCloudMapper.java
  59. 6 47
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/mapper/IotCompanyMapper.java
  60. 11 50
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/mapper/IotDeviceMapper.java
  61. 6 47
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/mapper/IotModMapper.java
  62. 15 45
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/mapper/IotProductMapper.java
  63. 6 47
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/mapper/IotProjectDeviceMapper.java
  64. 6 47
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/mapper/IotProjectMapper.java
  65. 6 47
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/mapper/IotUrlMapper.java
  66. 77 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotCloudService.java
  67. 14 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotCompanyService.java
  68. 0 51
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotCompanyServiceImpl.java
  69. 42 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotDeviceService.java
  70. 0 60
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotDeviceServiceImpl.java
  71. 46 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotModService.java
  72. 0 51
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotModServiceImpl.java
  73. 81 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotProductService.java
  74. 0 51
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotProductServiceImpl.java
  75. 14 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotProjectDeviceService.java
  76. 0 51
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotProjectDeviceServiceImpl.java
  77. 14 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotProjectService.java
  78. 0 51
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotProjectServiceImpl.java
  79. 75 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotUrlService.java
  80. 0 51
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotUrlServiceImpl.java
  81. 0 24
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/impl/IotCompanyService.java
  82. 0 29
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/impl/IotDeviceService.java
  83. 0 24
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/impl/IotModService.java
  84. 0 24
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/impl/IotProductService.java
  85. 0 24
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/impl/IotProjectDeviceService.java
  86. 0 24
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/impl/IotProjectService.java
  87. 0 24
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/impl/IotUrlService.java
  88. 23 0
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/resources/mapper/IotCloudMapper.xml
  89. 4 115
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/resources/mapper/IotCompanyMapper.xml
  90. 16 242
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/resources/mapper/IotDeviceMapper.xml
  91. 5 126
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/resources/mapper/IotModMapper.xml
  92. 17 223
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/resources/mapper/IotProductMapper.xml
  93. 6 135
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/resources/mapper/IotProjectDeviceMapper.xml
  94. 7 149
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/resources/mapper/IotProjectMapper.xml
  95. 5 158
      iot-module/iot-module-manage/iot-module-manage-biz/src/main/resources/mapper/IotUrlMapper.xml
  96. 2 1
      iot-module/iot-module-system/iot-module-system-api/src/main/java/com/middle/platform/system/api/feign/DictApi.java
  97. 21 0
      iot-module/iot-module-system/iot-module-system-api/src/main/java/com/middle/platform/system/api/feign/UserApi.java
  98. 15 0
      iot-module/iot-module-system/iot-module-system-api/src/main/java/com/middle/platform/system/api/pojo/SysUserFlag.java
  99. 0 8
      iot-module/iot-module-system/iot-module-system-api/src/main/java/com/middle/platform/system/api/pojo/User.java
  100. 16 0
      iot-module/iot-module-system/iot-module-system-api/src/main/java/com/middle/platform/system/api/pojo/UserDto.java

+ 8 - 0
iot-framework/iot-common/pom.xml

@@ -69,5 +69,13 @@
             <artifactId>pagehelper</artifactId>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-crypto</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+        </dependency>
     </dependencies>
 </project>

+ 0 - 9
iot-framework/iot-common/src/main/java/com/middle/platform/common/constant/RequestConstant.java

@@ -1,9 +0,0 @@
-package com.middle.platform.common.constant;
-
-
-public class RequestConstant {
-
-    /**请求头token*/
-    public static final String TOKEN = "Access-Token";
-
-}

+ 8 - 0
iot-framework/iot-common/src/main/java/com/middle/platform/common/constant/RpcConstants.java

@@ -0,0 +1,8 @@
+package com.middle.platform.common.constant;
+
+
+public class RpcConstants {
+
+    public static final String RPC_API_PREFIX = "/feign-api";
+
+}

+ 51 - 0
iot-framework/iot-common/src/main/java/com/middle/platform/common/utils/HashUtil.java

@@ -0,0 +1,51 @@
+package com.middle.platform.common.utils;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.security.crypto.argon2.Argon2PasswordEncoder;
+
+/**
+ * Hash加密相关算法
+ * PBKDF2、bcrypt、scrypt、Argon2等算法
+ *
+ */
+@Slf4j
+public class HashUtil {
+    private static final int SALT_LENGTH = 16;
+
+    private static final int HASH_LENGTH = 32;
+
+    private static final int PARALLELISM = 1;
+
+    private static final int MEMORY = 1 << 14;
+
+    private static final int ITERATIONS = 2;
+
+    /**
+     * 使用 Argon2(摘要加密的算法)
+     *
+     * @param password 原密码
+     * @return hash加密后的密码
+     */
+    public static String argon2(String password) {
+        Argon2PasswordEncoder encoder = new Argon2PasswordEncoder(SALT_LENGTH, HASH_LENGTH, PARALLELISM, MEMORY, ITERATIONS);
+        String hash = encoder.encode(password);
+        if (encoder.upgradeEncoding(hash)) {
+            hash = encoder.encode(hash);
+        }
+        return hash;
+    }
+
+    /**
+     * 校验数据
+     *
+     * @param rawPassword 原密码
+     * @param password    加密后的密码
+     * @return
+     */
+    public static Boolean argon2Match(String rawPassword, String password) {
+        Argon2PasswordEncoder encoder = new Argon2PasswordEncoder(SALT_LENGTH, HASH_LENGTH, PARALLELISM, MEMORY, ITERATIONS);
+        return encoder.matches(rawPassword, password);
+    }
+
+
+}

+ 38 - 0
iot-framework/iot-starter-biz-dict/pom.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.middle.platform</groupId>
+        <artifactId>iot-framework</artifactId>
+        <version>${revision}</version>
+    </parent>
+
+    <artifactId>iot-starter-biz-dict</artifactId>
+    <packaging>jar</packaging>
+    <properties>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>com.middle.platform</groupId>
+            <artifactId>iot-common</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.middle.platform</groupId>
+            <artifactId>iot-starter-feign</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.middle.platform</groupId>
+            <artifactId>iot-module-system-api</artifactId>
+        </dependency>
+    </dependencies>
+</project>

+ 18 - 0
iot-framework/iot-starter-biz-dict/src/main/java/com/middle/platform/biz/dict/config/DictAutoConfiguration.java

@@ -0,0 +1,18 @@
+package com.middle.platform.biz.dict.config;
+
+
+import com.middle.platform.biz.dict.core.util.DictFrameworkUtils;
+import com.middle.platform.system.api.feign.DictApi;
+import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.context.annotation.Bean;
+
+@AutoConfiguration
+public class DictAutoConfiguration {
+
+    @Bean
+    public DictFrameworkUtils dictUtils(DictApi dictApi) {
+        DictFrameworkUtils.init(dictApi);
+        return new DictFrameworkUtils();
+    }
+
+}

+ 11 - 0
iot-framework/iot-starter-biz-dict/src/main/java/com/middle/platform/biz/dict/config/DictFeignAutoConfiguration.java

@@ -0,0 +1,11 @@
+package com.middle.platform.biz.dict.config;
+
+import com.middle.platform.system.api.feign.DictApi;
+import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+
+
+@AutoConfiguration
+@EnableFeignClients(clients = DictApi.class)
+public class DictFeignAutoConfiguration {
+}

+ 71 - 0
iot-framework/iot-starter-biz-dict/src/main/java/com/middle/platform/biz/dict/core/util/DictFrameworkUtils.java

@@ -0,0 +1,71 @@
+package com.middle.platform.biz.dict.core.util;
+
+
+import cn.hutool.core.util.ObjectUtil;
+import com.google.common.cache.CacheLoader;
+import com.middle.platform.common.core.KeyValue;
+import com.middle.platform.common.utils.CacheUtils;
+import com.middle.platform.system.api.feign.DictApi;
+import com.middle.platform.system.api.pojo.DictDto;
+import lombok.SneakyThrows;
+import lombok.extern.slf4j.Slf4j;
+import com.google.common.cache.LoadingCache;
+
+import java.time.Duration;
+
+/**
+ * 字典工具类
+ */
+@Slf4j
+public class DictFrameworkUtils {
+
+    private static DictApi dictApi;
+
+    private static final DictDto DICT_DATA_NULL = new DictDto();
+
+    /**
+     * 针对 {@link #getDictDataLabel(String, String)} 的缓存
+     */
+    private static final LoadingCache<KeyValue<String, String>, DictDto> GET_DICT_DATA_CACHE = CacheUtils.buildAsyncReloadingCache(
+            Duration.ofMinutes(1L), // 过期时间 1 分钟
+            new CacheLoader<KeyValue<String, String>, DictDto>() {
+
+                @Override
+                public DictDto load(KeyValue<String, String> key) {
+                    return ObjectUtil.defaultIfNull(dictApi.getDictData(key.getKey(),key.getValue()).getData(),
+                            DICT_DATA_NULL);
+                }
+
+            });
+
+    /**
+     * 针对 {@link #parseDictDataValue(String, String)} 的缓存
+     */
+    private static final LoadingCache<KeyValue<String, String>, DictDto> PARSE_DICT_DATA_CACHE = CacheUtils.buildAsyncReloadingCache(
+            Duration.ofMinutes(1L), // 过期时间 1 分钟
+            new CacheLoader<KeyValue<String, String>, DictDto>() {
+
+                @Override
+                public DictDto load(KeyValue<String, String> key) {
+                    return ObjectUtil.defaultIfNull(null,
+                            DICT_DATA_NULL);
+                }
+
+            });
+
+    public static void init(DictApi dictApi) {
+        DictFrameworkUtils.dictApi = dictApi;
+        log.info("[init][初始化 DictFrameworkUtils 成功]");
+    }
+
+    @SneakyThrows
+    public static String getDictDataLabel(String dictType, String value) {
+        return GET_DICT_DATA_CACHE.get(new KeyValue<>(dictType, value)).getLabel();
+    }
+
+    @SneakyThrows
+    public static String parseDictDataValue(String dictType, String label) {
+        return PARSE_DICT_DATA_CACHE.get(new KeyValue<>(dictType, label)).getValue();
+    }
+
+}

+ 2 - 0
iot-framework/iot-starter-biz-dict/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@@ -0,0 +1,2 @@
+com.middle.platform.biz.dict.config.DictAutoConfiguration
+com.middle.platform.biz.dict.config.DictFeignAutoConfiguration

+ 5 - 0
iot-framework/iot-starter-feign/pom.xml

@@ -32,5 +32,10 @@
             <groupId>jakarta.validation</groupId>
             <artifactId>jakarta.validation-api</artifactId>
         </dependency>
+        <dependency>
+            <groupId>jakarta.servlet</groupId>
+            <artifactId>jakarta.servlet-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
     </dependencies>
 </project>

+ 26 - 0
iot-framework/iot-starter-feign/src/main/java/com/middle/platform/feign/core/FeignInterceptor.java

@@ -0,0 +1,26 @@
+package com.middle.platform.feign.core;
+
+import feign.RequestInterceptor;
+import feign.RequestTemplate;
+import jakarta.servlet.http.HttpServletRequest;
+import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+/**
+ *
+ */
+@AutoConfiguration
+public class FeignInterceptor implements RequestInterceptor {
+
+    @Override
+    public void apply(RequestTemplate requestTemplate) {
+        ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
+        if (attributes != null) {
+            HttpServletRequest request = attributes.getRequest();
+            String cookie = request.getHeader("Cookie");
+            requestTemplate.header("Cookie", cookie);
+        }
+    }
+
+}

+ 1 - 0
iot-framework/iot-starter-feign/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@@ -0,0 +1 @@
+com.middle.platform.feign.core.FeignInterceptor

+ 0 - 5
iot-framework/iot-starter-mybatis/src/main/java/com/middle/platform/mybatis/core/dataobject/BaseVO.java

@@ -32,9 +32,4 @@ public abstract class BaseVO implements Serializable {
      */
     @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime updateTime;
-    /**
-     * 删除时间
-     */
-    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private LocalDateTime deleteTime;
 }

+ 3 - 1
iot-framework/iot-starter-satoken/src/main/java/com/middle/platform/satoken/config/SaTokenConfig.java

@@ -5,6 +5,7 @@ import cn.dev33.satoken.filter.SaServletFilter;
 import cn.dev33.satoken.interceptor.SaInterceptor;
 import cn.dev33.satoken.router.SaRouter;
 import cn.dev33.satoken.stp.StpUtil;
+import com.middle.platform.common.constant.RpcConstants;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.boot.autoconfigure.AutoConfiguration;
 import org.springframework.context.annotation.Bean;
@@ -15,7 +16,8 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 @AutoConfiguration
 public class SaTokenConfig implements WebMvcConfigurer {
     private final String[] exclude = new String[]{
-            "/auth/login", "/auth/logout"
+            RpcConstants.RPC_API_PREFIX + "/**",
+            "/auth/login", "/auth/logout",
     };
 
     @Bean

+ 25 - 0
iot-framework/iot-starter-web/src/main/java/com/middle/platform/web/config/GlobalExceptionHandler.java

@@ -7,9 +7,15 @@ import com.middle.platform.common.exception.ResultCode;
 import com.middle.platform.common.utils.Result;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.util.CollectionUtils;
+import org.springframework.validation.FieldError;
+import org.springframework.web.bind.MethodArgumentNotValidException;
 import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.RestControllerAdvice;
 
+import java.util.List;
+
 /**
  * 全局异常
  */
@@ -41,5 +47,24 @@ public class GlobalExceptionHandler {
         return Result.failed(ResultCode.ERROR, Global.UN_AUTH);
     }
 
+    @ResponseBody
+    @ExceptionHandler(MethodArgumentNotValidException.class)
+    public Result<Integer> methodArgumentNotValidExceptionHandler(MethodArgumentNotValidException ex) {
+        List<FieldError> fieldErrors = ex.getBindingResult().getFieldErrors();
+        StringBuilder sb = new StringBuilder();
+        if (!CollectionUtils.isEmpty(fieldErrors)) {
+            boolean first = true;
+            for (FieldError fieldError : fieldErrors) {
+                if (!first) {
+                    sb.append(",");
+                }
+                sb.append(fieldError.getDefaultMessage());
+                first = false;
+            }
+        }
+        String errMsg = sb.toString();
+        log.error("参数校验异常:{}", errMsg);
+        return Result.failed(ResultCode.ERROR, errMsg);
+    }
 
 }

+ 2 - 0
iot-framework/pom.xml

@@ -27,7 +27,9 @@
         <module>iot-starter-log</module>
         <module>iot-starter-satoken</module>
         <module>iot-starter-pagehelper</module>
+        <module>iot-starter-biz-dict</module>
     </modules>
+
     <properties>
         <maven.compiler.source>17</maven.compiler.source>
         <maven.compiler.target>17</maven.compiler.target>

+ 4 - 0
iot-gateway/pom.xml

@@ -55,5 +55,9 @@
             <groupId>com.middle.platform</groupId>
             <artifactId>iot-common</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-webmvc</artifactId>
+        </dependency>
     </dependencies>
 </project>

+ 1 - 1
iot-module/iot-module-auth/iot-module-auth-api/src/main/java/com/middle/platform/auth/api/enums/ApiConstants.java

@@ -5,7 +5,7 @@ package com.middle.platform.auth.api.enums;
  * @date 2023-12-03 10:28:58
  */
 public class ApiConstants {
-    public static final String NAME = "system-server";
+    public static final String NAME = "iot-auth";
 
     public static final String VERSION = "1.0.0";
 

+ 2 - 1
iot-module/iot-module-auth/iot-module-auth-api/src/main/java/com/middle/platform/auth/api/feign/AuthApi.java

@@ -1,6 +1,7 @@
 package com.middle.platform.auth.api.feign;
 
 import com.middle.platform.auth.api.enums.ApiConstants;
+import com.middle.platform.common.constant.RpcConstants;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -11,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestParam;
  */
 @FeignClient(name = ApiConstants.NAME)
 public interface AuthApi {
-    String prefix = "auth";
+    String prefix = RpcConstants.RPC_API_PREFIX+"auth";
 
     @GetMapping(prefix + "/get")
     String queryAccount(@RequestParam("account") String account);

+ 4 - 0
iot-module/iot-module-auth/iot-module-auth-biz/pom.xml

@@ -74,6 +74,10 @@
             <groupId>com.middle.platform</groupId>
             <artifactId>iot-module-auth-api</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.middle.platform</groupId>
+            <artifactId>iot-module-system-api</artifactId>
+        </dependency>
 
     </dependencies>
 </project>

+ 16 - 0
iot-module/iot-module-auth/iot-module-auth-biz/src/main/java/com/middle/platform/auth/biz/config/FeignConfig.java

@@ -0,0 +1,16 @@
+package com.middle.platform.auth.biz.config;
+
+import com.middle.platform.system.api.feign.UserApi;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * 配置feign接口
+ *
+ * @author xucaiqin
+ * @date 2023-12-19 11:00:25
+ */
+@Configuration
+@EnableFeignClients(clients = UserApi.class)
+public class FeignConfig {
+}

+ 45 - 3
iot-module/iot-module-auth/iot-module-auth-biz/src/main/java/com/middle/platform/auth/biz/controller/AuthController.java

@@ -2,7 +2,12 @@ package com.middle.platform.auth.biz.controller;
 
 import cn.dev33.satoken.stp.StpUtil;
 import com.middle.platform.auth.biz.pojo.LoginPara;
+import com.middle.platform.auth.biz.service.AuthService;
 import com.middle.platform.common.utils.Result;
+import com.middle.platform.system.api.pojo.SysUserFlag;
+import jakarta.validation.constraints.NotNull;
+import lombok.RequiredArgsConstructor;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 /**
@@ -11,18 +16,55 @@ import org.springframework.web.bind.annotation.*;
  */
 @RestController
 @RequestMapping("/auth")
+@Validated
+@RequiredArgsConstructor
 public class AuthController {
+    private final AuthService authService;
 
 
+    /**
+     * 登录
+     *
+     * @param loginPara
+     * @return
+     */
     @PostMapping("/login")
     public Result<Object> login(@RequestBody LoginPara loginPara) {
-        StpUtil.login(loginPara.getUsername());
-        return Result.ok(true);
+        return Result.ok(authService.authUser(loginPara));
     }
+
+    /**
+     * 重置密码
+     *
+     * @param id
+     * @return
+     */
+    @PostMapping("/resetPass")
+    public Result<Object> resetPass(@RequestParam @NotNull(message = "用户id不能为空") Long id) {
+        authService.resetPassword(id);
+        return Result.ok(true, "重置成功");
+    }
+
+    /**
+     * 启用禁用
+     *
+     * @return
+     */
+    @PostMapping("/use")
+    public Result<Object> use(@RequestBody SysUserFlag sysUserFlag) {
+        authService.changeUse(sysUserFlag);
+        return Result.ok(true, "操作成功");
+    }
+
+    /**
+     * 退出登录
+     *
+     * @return
+     */
     @PostMapping("/logout")
     public Result<Object> logout() {
         StpUtil.logout();
-        return Result.ok(true);
+        return Result.ok(true, "登出成功");
     }
 
     @GetMapping("/check")

+ 3 - 0
iot-module/iot-module-auth/iot-module-auth-biz/src/main/java/com/middle/platform/auth/biz/pojo/LoginPara.java

@@ -1,5 +1,6 @@
 package com.middle.platform.auth.biz.pojo;
 
+import jakarta.validation.constraints.NotBlank;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -15,6 +16,8 @@ import java.io.Serializable;
 public class LoginPara implements Serializable {
     @Serial
     private static final long serialVersionUID = -6465590981279725908L;
+    @NotBlank(message = "账号不能为空")
     private String username;
+    @NotBlank(message = "密码不能为空")
     private String password;
 }

+ 61 - 0
iot-module/iot-module-auth/iot-module-auth-biz/src/main/java/com/middle/platform/auth/biz/service/AuthService.java

@@ -0,0 +1,61 @@
+package com.middle.platform.auth.biz.service;
+
+import cn.dev33.satoken.stp.StpUtil;
+import com.middle.platform.auth.biz.pojo.LoginPara;
+import com.middle.platform.common.exception.BusinessException;
+import com.middle.platform.common.utils.HashUtil;
+import com.middle.platform.system.api.feign.UserApi;
+import com.middle.platform.system.api.pojo.SysUserFlag;
+import com.middle.platform.system.api.pojo.UserDto;
+import jakarta.annotation.Resource;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.util.Objects;
+
+/**
+ * @author xucaiqin
+ * @date 2023-12-17 10:49:41
+ */
+@Service
+@RequiredArgsConstructor
+public class AuthService {
+    @Resource
+    private UserApi userApi;
+
+    /**
+     * 用户登录认证
+     *
+     * @param loginPara
+     * @return
+     */
+    public Object authUser(LoginPara loginPara) {
+        UserDto userDto = userApi.queryAccount(loginPara.getUsername());
+        if (Objects.isNull(userDto)) {
+            throw new BusinessException("账号不存在");
+        }
+        if (HashUtil.argon2Match(loginPara.getPassword(), userDto.getPassword())) {
+            StpUtil.login(userDto.getId());
+            return true;
+        }
+        throw new BusinessException("账号或密码不正确");
+    }
+
+    /**
+     * 重置密码
+     *
+     * @param id 用户id
+     */
+    public void resetPassword(Long id) {
+        userApi.resetPassword(id);
+    }
+
+    /**
+     * 用户启用/禁用
+     *
+     * @param sysUserFlag
+     */
+    public void changeUse(SysUserFlag sysUserFlag) {
+        userApi.changeUse(sysUserFlag);
+    }
+}

+ 0 - 16
iot-module/iot-module-auth/iot-module-auth-biz/src/main/java/com/middle/platform/auth/biz/service/TestService.java

@@ -1,16 +0,0 @@
-package com.middle.platform.auth.biz.service;
-
-import com.github.pagehelper.PageHelper;
-import org.springframework.stereotype.Service;
-
-/**
- * @author xucaiqin
- * @date 2023-12-17 10:49:41
- */
-@Service
-public class TestService {
-    public Object test() {
-        PageHelper.startPage(1, 1);
-        return null;
-    }
-}

+ 2 - 14
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/controller/IotCompanyController.java

@@ -1,9 +1,7 @@
 package com.middle.platform.manage.biz.controller;
 
-import com.middle.platform.manage.biz.domain.IotCompany;
-import com.middle.platform.manage.biz.service.IotCompanyServiceImpl;
+import com.middle.platform.manage.biz.service.IotCompanyService;
 import lombok.RequiredArgsConstructor;
-import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -19,17 +17,7 @@ public class IotCompanyController {
     /**
      * 服务对象
      */
-    private final IotCompanyServiceImpl iotCompanyServiceImpl;
+    private final IotCompanyService iotCompanyService;
 
-    /**
-     * 通过主键查询单条数据
-     *
-     * @param id 主键
-     * @return 单条数据
-     */
-    @GetMapping("selectOne")
-    public IotCompany selectOne(Long id) {
-        return iotCompanyServiceImpl.selectByPrimaryKey(id);
-    }
 
 }

+ 29 - 22
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/controller/IotDeviceController.java

@@ -1,18 +1,16 @@
 package com.middle.platform.manage.biz.controller;
 
 import com.middle.platform.common.utils.Result;
-import com.middle.platform.manage.biz.domain.IotDevice;
-import com.middle.platform.manage.biz.domain.vo.req.IotDeviceVo;
-import com.middle.platform.manage.biz.service.IotDeviceServiceImpl;
+import com.middle.platform.manage.biz.domain.req.DevicePage;
+import com.middle.platform.manage.biz.domain.req.IotDevicePara;
+import com.middle.platform.manage.biz.service.IotDeviceService;
 import lombok.RequiredArgsConstructor;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.List;
-
 
 /**
- * 设备表(iot_device)表控制层
+ * 设备表
  *
  * @author Aick Spt
  * @date 2023-12-18 10:38
@@ -21,30 +19,39 @@ import java.util.List;
 @RequestMapping("/device")
 @RequiredArgsConstructor
 public class IotDeviceController {
+    private final IotDeviceService iotDeviceService;
+
     /**
-     * 服务对象
+     * 分页查询设备据
+     *
+     * @param devicePage
+     * @return
      */
-    private final IotDeviceServiceImpl iotDeviceServiceImpl;
-
-
-    @PostMapping(name = "获取设备",path = "/select")
-    public Result<IotDevice> select(@RequestBody @Validated IotDeviceVo params){
-
-        List<IotDevice> list = iotDeviceServiceImpl.select(params);
-
-        return Result.ok(iotDeviceServiceImpl.selectByPrimaryKey(null));
+    @PostMapping("/list")
+    public Result<Object> list(@RequestBody @Validated DevicePage devicePage) {
+        return Result.ok(iotDeviceService.pageQuery(devicePage));
     }
 
+    /**
+     * 新增设备
+     *
+     * @param iotDevicePara
+     * @return
+     */
+    @PostMapping("/save")
+    public Result<Object> save(@RequestBody @Validated IotDevicePara iotDevicePara) {
+        return Result.ok(iotDeviceService.save(iotDevicePara));
+    }
 
     /**
-     * 通过主键查询单条数据
+     * 删除设备
      *
-     * @param id 主键
-     * @return 单条数据
+     * @param id 设备id
+     * @return
      */
-    @GetMapping("selectOne")
-    public Result<IotDevice> selectOne(Long id) {
-        return Result.ok(iotDeviceServiceImpl.selectByPrimaryKey(id));
+    @DeleteMapping("/remove/{id}")
+    public Result<Object> remove(@PathVariable("id") Long id) {
+        return Result.ok(iotDeviceService.remove(id), "删除成功");
     }
 
 }

+ 0 - 35
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/controller/IotModController.java

@@ -1,35 +0,0 @@
-package com.middle.platform.manage.biz.controller;
-
-import com.middle.platform.manage.biz.domain.IotMod;
-import com.middle.platform.manage.biz.service.IotModServiceImpl;
-import lombok.RequiredArgsConstructor;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * 物模型表(iot_mod)表控制层
- *
- * @author xxxxx
- */
-@RestController
-@RequestMapping("/iot_mod")
-@RequiredArgsConstructor
-public class IotModController {
-    /**
-     * 服务对象
-     */
-    private final IotModServiceImpl iotModServiceImpl;
-
-    /**
-     * 通过主键查询单条数据
-     *
-     * @param id 主键
-     * @return 单条数据
-     */
-    @GetMapping("selectOne")
-    public IotMod selectOne(Long id) {
-        return iotModServiceImpl.selectByPrimaryKey(id);
-    }
-
-}

+ 111 - 17
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/controller/IotProductController.java

@@ -1,35 +1,129 @@
 package com.middle.platform.manage.biz.controller;
 
-import com.middle.platform.manage.biz.domain.IotProduct;
-import com.middle.platform.manage.biz.service.IotProductServiceImpl;
+import com.middle.platform.common.utils.Result;
+import com.middle.platform.manage.biz.domain.req.*;
+import com.middle.platform.manage.biz.service.IotCloudService;
+import com.middle.platform.manage.biz.service.IotModService;
+import com.middle.platform.manage.biz.service.IotProductService;
+import com.middle.platform.manage.biz.service.IotUrlService;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotBlank;
 import lombok.RequiredArgsConstructor;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
 
 /**
- * 产品表(iot_product)表控制层
- *
- * @author xxxxx
+ * 产品表
  */
 @RestController
-@RequestMapping("/iot_product")
+@RequestMapping("/iotProduct")
 @RequiredArgsConstructor
+@Validated
 public class IotProductController {
+    private final IotProductService iotProductService;
+    private final IotModService iotModService;
+    private final IotCloudService iotCloudService;
+    private final IotUrlService iotUrlService;
+
     /**
-     * 服务对象
+     * 分页查询产品数据
+     *
+     * @param productPage
+     * @return
      */
-    private final IotProductServiceImpl iotProductServiceImpl;
+    @PostMapping("/list")
+    public Result<Object> list(@RequestBody @Validated ProductPage productPage) {
+        return Result.ok(iotProductService.pageQuery(productPage));
+    }
 
     /**
-     * 通过主键查询单条数据
+     * 新增产品
      *
-     * @param id 主键
-     * @return 单条数据
+     * @param iotProductPara
+     * @return
      */
-    @GetMapping("selectOne")
-    public IotProduct selectOne(Long id) {
-        return iotProductServiceImpl.selectByPrimaryKey(id);
+    @PostMapping("/save")
+    public Result<Object> save(@RequestBody @Validated IotProductPara iotProductPara) {
+        return Result.ok(iotProductService.save(iotProductPara));
     }
 
+    /**
+     * 删除产品
+     *
+     * @param id 产品id
+     * @return
+     */
+    @DeleteMapping("/remove/{id}")
+    public Result<Object> remove(@PathVariable("id") Long id) {
+        return Result.ok(iotProductService.remove(id), "删除成功");
+    }
+
+    //物模型
+
+    /**
+     * 保存物模型
+     *
+     * @return
+     */
+    @PostMapping("/saveMod")
+    public Result<Object> saveMod(@RequestBody @Valid IotModPara iotModPara) {
+        return Result.ok(iotModService.save(iotModPara), "保存成功");
+    }
+    //云函数
+
+    /**
+     * 保存云函数
+     *
+     * @return
+     */
+    @PostMapping("/saveCloud")
+    public Result<Object> saveCloud(@RequestBody @Valid IotCloudPara iotCloudPara) {
+        return Result.ok(iotCloudService.save(iotCloudPara), "保存成功");
+    }
+
+    /**
+     * 云函数测试
+     *
+     * @param iotCloudTest
+     * @return
+     */
+    @PostMapping("/testCloud")
+    public Result<Object> testCloud(@RequestBody @Valid IotCloudTest iotCloudTest) {
+        return Result.ok(iotCloudService.test(iotCloudTest), "测试");
+    }
+
+    //通信地址
+
+    /**
+     * 产品对应的通信地址配置
+     *
+     * @param iotUrlPara
+     * @return
+     */
+    @PostMapping("/urlConfig")
+    public Result<Object> urlConfig(@RequestBody @Valid IotUrlPara iotUrlPara) {
+        return Result.ok(iotUrlService.saveUrl(iotUrlPara), "保存成功");
+    }
+
+    /**
+     * 更新通信地址
+     *
+     * @param iotUrlPara
+     * @return
+     */
+    @PostMapping("/update")
+    public Result<Object> update(@RequestBody @Valid IotUrlPara iotUrlPara) {
+        return Result.ok(iotUrlService.update(iotUrlPara), "修改成功");
+    }
+
+    /**
+     * 删除通信地址
+     *
+     * @param id 主键
+     * @return
+     */
+    @DeleteMapping("/removeUrl/{id}")
+    public Result<Object> removeUrl(@PathVariable("id") @NotBlank(message = "id不能为空") Long id) {
+        return Result.ok(iotUrlService.remove(id), "删除成功");
+    }
 }

+ 0 - 18
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/controller/IotProjectController.java

@@ -1,9 +1,6 @@
 package com.middle.platform.manage.biz.controller;
 
-import com.middle.platform.manage.biz.domain.IotProject;
-import com.middle.platform.manage.biz.service.IotProjectServiceImpl;
 import lombok.RequiredArgsConstructor;
-import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -16,20 +13,5 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping("/iot_project")
 @RequiredArgsConstructor
 public class IotProjectController {
-    /**
-     * 服务对象
-     */
-    private final IotProjectServiceImpl iotProjectServiceImpl;
-
-    /**
-     * 通过主键查询单条数据
-     *
-     * @param id 主键
-     * @return 单条数据
-     */
-    @GetMapping("selectOne")
-    public IotProject selectOne(Long id) {
-        return iotProjectServiceImpl.selectByPrimaryKey(id);
-    }
 
 }

+ 0 - 18
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/controller/IotProjectDeviceController.java

@@ -1,9 +1,6 @@
 package com.middle.platform.manage.biz.controller;
 
-import com.middle.platform.manage.biz.domain.IotProjectDevice;
-import com.middle.platform.manage.biz.service.IotProjectDeviceServiceImpl;
 import lombok.RequiredArgsConstructor;
-import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -16,20 +13,5 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping("/iot_project_device")
 @RequiredArgsConstructor
 public class IotProjectDeviceController {
-    /**
-     * 服务对象
-     */
-    private final IotProjectDeviceServiceImpl iotProjectDeviceServiceImpl;
-
-    /**
-     * 通过主键查询单条数据
-     *
-     * @param id 主键
-     * @return 单条数据
-     */
-    @GetMapping("selectOne")
-    public IotProjectDevice selectOne(Long id) {
-        return iotProjectDeviceServiceImpl.selectByPrimaryKey(id);
-    }
 
 }

+ 0 - 35
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/controller/IotUrlController.java

@@ -1,35 +0,0 @@
-package com.middle.platform.manage.biz.controller;
-
-import com.middle.platform.manage.biz.domain.IotUrl;
-import com.middle.platform.manage.biz.service.IotUrlServiceImpl;
-import lombok.RequiredArgsConstructor;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * 数据上下行关系表(iot_url)表控制层
- *
- * @author xxxxx
- */
-@RestController
-@RequestMapping("/iot_url")
-@RequiredArgsConstructor
-public class IotUrlController {
-    /**
-     * 服务对象
-     */
-    private final IotUrlServiceImpl iotUrlServiceImpl;
-
-    /**
-     * 通过主键查询单条数据
-     *
-     * @param id 主键
-     * @return 单条数据
-     */
-    @GetMapping("selectOne")
-    public IotUrl selectOne(Long id) {
-        return iotUrlServiceImpl.selectByPrimaryKey(id);
-    }
-
-}

+ 0 - 45
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/IotCompany.java

@@ -1,45 +0,0 @@
-package com.middle.platform.manage.biz.domain;
-
-import java.util.Date;
-import lombok.Builder;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.experimental.Accessors;
-import lombok.experimental.SuperBuilder;
-
-/**
- * @author Aick Spt
- * @date 2023-12-18 10:09
- */
-
-/**
-    * 企业表
-    */
-@Getter
-@Setter
-@Accessors(chain = true)
-@SuperBuilder
-@Builder
-public class IotCompany {
-    private Long id;
-
-    /**
-    * 企业名称
-    */
-    private String title;
-
-    /**
-    * 备注
-    */
-    private String remark;
-
-    private Integer createBy;
-
-    private Date createTime;
-
-    private Integer updateBy;
-
-    private Date updateTime;
-
-    private Date deleteTime;
-}

+ 0 - 103
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/IotDevice.java

@@ -1,103 +0,0 @@
-package com.middle.platform.manage.biz.domain;
-
-import java.math.BigDecimal;
-import java.util.Date;
-
-import com.middle.platform.mybatis.core.dataobject.BaseDO;
-import lombok.Builder;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.experimental.Accessors;
-import lombok.experimental.SuperBuilder;
-
-/**
- * @author Aick Spt
- * @date 2023-12-18 10:09
- */
-
-/**
-    * 设备表
-    */
-@Getter
-@Setter
-@Accessors(chain = true)
-@SuperBuilder
-@Builder
-public class IotDevice extends BaseDO {
-    private Long id;
-
-    /**
-    * 所属产品
-    */
-    private Long productId;
-
-    /**
-    * 设备名称
-    */
-    private String name;
-
-    /**
-    * 设备sn码
-    */
-    private String sn;
-
-    /**
-    * 设备guid
-    */
-    private String guid;
-
-    /**
-    * 备注名称
-    */
-    private String subtitle;
-
-    /**
-    * 经度
-    */
-    private BigDecimal lon;
-
-    /**
-    * 纬度
-    */
-    private BigDecimal lat;
-
-    /**
-    * 所属区域
-    */
-    private String address;
-
-    /**
-    * 最后在线时间
-    */
-    private Date onlineTime;
-
-    /**
-    * 设备状态 1-在线 0-离线
-    */
-    private Byte status;
-
-    /**
-    * 启用状态 1-启用 0-禁用
-    */
-    private Byte enableFlag;
-
-    /**
-    * 备注
-    */
-    private String remark;
-
-    private Integer createBy;
-
-    private Date createTime;
-
-    private Integer updateBy;
-
-    private Date updateTime;
-
-    private Date deleteTime;
-
-    /**
-    * 删除标识
-    */
-    private Byte delFlag;
-}

+ 0 - 50
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/IotMod.java

@@ -1,50 +0,0 @@
-package com.middle.platform.manage.biz.domain;
-
-import java.util.Date;
-import lombok.Builder;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.experimental.Accessors;
-import lombok.experimental.SuperBuilder;
-
-/**
- * @author Aick Spt
- * @date 2023-12-18 10:09
- */
-
-/**
-    * 物模型表
-    */
-@Getter
-@Setter
-@Accessors(chain = true)
-@SuperBuilder
-@Builder
-public class IotMod {
-    private Long id;
-
-    /**
-    * 产品id
-    */
-    private Long productId;
-
-    /**
-    * 物模型TSL的JSON
-    */
-    private String tslJson;
-
-    private Integer createBy;
-
-    private Date createTime;
-
-    private Integer updateBy;
-
-    private Date updateTime;
-
-    private Date deleteTime;
-
-    /**
-    * 删除标识
-    */
-    private Byte delFlag;
-}

+ 0 - 95
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/IotProduct.java

@@ -1,95 +0,0 @@
-package com.middle.platform.manage.biz.domain;
-
-import java.util.Date;
-import lombok.Builder;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.experimental.Accessors;
-import lombok.experimental.SuperBuilder;
-
-/**
- * @author Aick Spt
- * @date 2023-12-18 10:09
- */
-
-/**
-    * 产品表
-    */
-@Getter
-@Setter
-@Accessors(chain = true)
-@SuperBuilder
-@Builder
-public class IotProduct {
-    private Long id;
-
-    /**
-    * 产品编码
-    */
-    private String code;
-
-    /**
-    * 产品名称
-    */
-    private String name;
-
-    /**
-    * 密匙(未知作用)
-    */
-    private String secret;
-
-    /**
-    * 节点类型:1网关、2子设备
-    */
-    private Byte nodeType;
-
-    /**
-    * 联网类型
-    */
-    private Byte networkType;
-
-    /**
-    * 上报协议
-    */
-    private Byte reportProtocol;
-
-    /**
-    * 数据格式
-    */
-    private Byte dataFormat;
-
-    /**
-    * 认证方式
-    */
-    private Byte authType;
-
-    /**
-    * 产品标签
-    */
-    private String tag;
-
-    /**
-    * 设备数
-    */
-    private Integer size;
-
-    /**
-    * 备注
-    */
-    private String remark;
-
-    private Integer createBy;
-
-    private Date createTime;
-
-    private Integer updateBy;
-
-    private Date updateTime;
-
-    private Date deleteTime;
-
-    /**
-    * 删除标识
-    */
-    private Byte delFlag;
-}

+ 0 - 60
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/IotProject.java

@@ -1,60 +0,0 @@
-package com.middle.platform.manage.biz.domain;
-
-import java.util.Date;
-import lombok.Builder;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.experimental.Accessors;
-import lombok.experimental.SuperBuilder;
-
-/**
- * @author Aick Spt
- * @date 2023-12-18 10:09
- */
-
-/**
-    * 项目表
-    */
-@Getter
-@Setter
-@Accessors(chain = true)
-@SuperBuilder
-@Builder
-public class IotProject {
-    private Long id;
-
-    /**
-    * 所属企业id
-    */
-    private Long companyId;
-
-    /**
-    * 项目编号
-    */
-    private String code;
-
-    /**
-    * 项目名称
-    */
-    private String title;
-
-    /**
-    * 备注
-    */
-    private String remark;
-
-    /**
-    * 状态
-    */
-    private Byte status;
-
-    private Integer createBy;
-
-    private Date createTime;
-
-    private Integer updateBy;
-
-    private Date updateTime;
-
-    private Date deleteTime;
-}

+ 0 - 53
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/IotProjectDevice.java

@@ -1,53 +0,0 @@
-package com.middle.platform.manage.biz.domain;
-
-import java.util.Date;
-import lombok.Builder;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.experimental.Accessors;
-import lombok.experimental.SuperBuilder;
-
-/**
- * @author Aick Spt
- * @date 2023-12-18 10:09
- */
-
-/**
-    * 产品关联设备表
-    */
-@Getter
-@Setter
-@Accessors(chain = true)
-@SuperBuilder
-@Builder
-public class IotProjectDevice {
-    /**
-    * id
-    */
-    private Long id;
-
-    /**
-    * 项目id
-    */
-    private Long projectId;
-
-    /**
-    * 设备id
-    */
-    private Long deviceId;
-
-    private Integer createBy;
-
-    private Date updateTime;
-
-    private Integer updateBy;
-
-    private Date createTime;
-
-    private Date deleteTime;
-
-    /**
-    * 删除标识
-    */
-    private Byte delFlag;
-}

+ 0 - 65
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/IotUrl.java

@@ -1,65 +0,0 @@
-package com.middle.platform.manage.biz.domain;
-
-import java.util.Date;
-import lombok.Builder;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.experimental.Accessors;
-import lombok.experimental.SuperBuilder;
-
-/**
- * @author Aick Spt
- * @date 2023-12-18 10:09
- */
-
-/**
-    * 数据上下行关系表
-    */
-@Getter
-@Setter
-@Accessors(chain = true)
-@SuperBuilder
-@Builder
-public class IotUrl {
-    private Long id;
-
-    /**
-    * 产品id
-    */
-    private Long productId;
-
-    /**
-    * 地址 topic地址 https地址
-    */
-    private String url;
-
-    /**
-    * 地址类型 1-mqtt 2-http 3-coap
-    */
-    private Byte type;
-
-    /**
-    * 设备权限:1发布 2订阅 3发布和订阅
-    */
-    private Byte permission;
-
-    /**
-    * 备注
-    */
-    private String remark;
-
-    private Integer createBy;
-
-    private Date createTime;
-
-    private Integer updateBy;
-
-    private Date updateTime;
-
-    private Date deleteTime;
-
-    /**
-    * 删除标识
-    */
-    private Byte delFlag;
-}

+ 14 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/req/DevicePage.java

@@ -0,0 +1,14 @@
+package com.middle.platform.manage.biz.domain.req;
+
+import com.middle.platform.common.modle.BasePara;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author xucaiqin
+ * @date 2023-12-19 14:16:35
+ */
+@Getter
+@Setter
+public class DevicePage extends BasePara {
+}

+ 35 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/req/IotCloudPara.java

@@ -0,0 +1,35 @@
+package com.middle.platform.manage.biz.domain.req;
+
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 云函数
+ *
+ * @author xucaiqin
+ * @date 2023-12-19 13:43:38
+ */
+@Getter
+@Setter
+public class IotCloudPara {
+
+    /**
+     * 产品id
+     */
+    @NotNull(message = "产品id不能为空")
+    private Long productId;
+
+    /**
+     * 脚本语言 1-js 2-php
+     */
+    @NotNull(message = "脚本语言不能为空")
+    private Integer lang;
+
+    /**
+     * 云函数
+     */
+    @NotBlank(message = "云函数不能为空")
+    private String cloudText;
+}

+ 35 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/req/IotCloudTest.java

@@ -0,0 +1,35 @@
+package com.middle.platform.manage.biz.domain.req;
+
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 云函数
+ *
+ * @author xucaiqin
+ * @date 2023-12-19 13:43:38
+ */
+@Getter
+@Setter
+public class IotCloudTest {
+
+    /**
+     * 产品id
+     */
+    @NotNull(message = "产品id不能为空")
+    private Long productId;
+
+    /**
+     * 脚本语言 1-js 2-php
+     */
+    @NotNull(message = "脚本语言不能为空")
+    private Integer lang;
+
+    /**
+     * 云函数
+     */
+    @NotBlank(message = "云函数不能为空")
+    private String cloudText;
+}

+ 96 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/req/IotDevicePara.java

@@ -0,0 +1,96 @@
+package com.middle.platform.manage.biz.domain.req;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.middle.platform.mybatis.core.dataobject.BaseDO;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * 设备表
+ *
+ * @author xucaiqin
+ * @date 2023-12-19 13:43:38
+ */
+@Getter
+@Setter
+@TableName(value = "iot_device")
+public class IotDevicePara{
+
+    /**
+     * 所属产品
+     */
+    @TableField(value = "product_id")
+    private Long productId;
+
+    /**
+     * 设备名称
+     */
+    @TableField(value = "`name`")
+    private String name;
+
+    /**
+     * 设备sn码
+     */
+    @TableField(value = "sn")
+    private String sn;
+
+    /**
+     * 设备guid
+     */
+    @TableField(value = "guid")
+    private String guid;
+
+    /**
+     * 备注名称
+     */
+    @TableField(value = "subtitle")
+    private String subtitle;
+
+    /**
+     * 经度
+     */
+    @TableField(value = "lon")
+    private BigDecimal lon;
+
+    /**
+     * 纬度
+     */
+    @TableField(value = "lat")
+    private BigDecimal lat;
+
+    /**
+     * 所属区域
+     */
+    @TableField(value = "address")
+    private String address;
+
+    /**
+     * 最后在线时间
+     */
+    @TableField(value = "online_time")
+    private LocalDateTime onlineTime;
+
+    /**
+     * 设备状态 1-在线 0-离线
+     */
+    @TableField(value = "`status`")
+    private Integer status;
+
+    /**
+     * 启用状态 1-启用 0-禁用
+     */
+    @TableField(value = "enable_flag")
+    private Integer enableFlag;
+
+    /**
+     * 备注
+     */
+    @TableField(value = "remark")
+    private String remark;
+}

+ 2 - 2
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/vo/req/IotDeviceVo.java → iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/req/IotDeviceVo.java

@@ -1,4 +1,4 @@
-package com.middle.platform.manage.biz.domain.vo.req;
+package com.middle.platform.manage.biz.domain.req;
 
 import jakarta.validation.constraints.NotBlank;
 import lombok.Getter;
@@ -12,7 +12,7 @@ import lombok.ToString;
 @Getter
 @Setter
 @ToString
-public class IotDeviceVo{
+public class IotDeviceVo {
 
     private Long id;
 

+ 27 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/req/IotModPara.java

@@ -0,0 +1,27 @@
+package com.middle.platform.manage.biz.domain.req;
+
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 物模型
+ */
+@Getter
+@Setter
+public class IotModPara {
+
+    /**
+     * 产品id
+     */
+    @NotNull(message = "产品id不能为空")
+    private Long productId;
+
+    /**
+     * 物模型TSL的JSON
+     */
+    @NotBlank(message = "物模型TSL不能为空")
+    private String tslJson;
+
+}

+ 76 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/req/IotProductPara.java

@@ -0,0 +1,76 @@
+package com.middle.platform.manage.biz.domain.req;
+
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 产品
+ */
+@Getter
+@Setter
+public class IotProductPara {
+
+    /**
+     * 产品编码
+     */
+    private String code;
+
+    /**
+     * 产品名称
+     */
+    @NotBlank(message = "产品名称不能为空")
+    private String name;
+
+    /**
+     * 密匙(未知作用)
+     */
+    private String secret;
+
+    /**
+     * 节点类型:1网关、2子设备
+     */
+    @NotNull(message = "节点类型不能为空")
+    private Integer nodeType;
+
+    /**
+     * 联网类型
+     */
+    @NotNull(message = "联网类型不能为空")
+    private Integer networkType;
+
+    /**
+     * 上报协议
+     */
+    @NotNull(message = "上报协议不能为空")
+    private Integer reportProtocol;
+
+    /**
+     * 数据格式
+     */
+    @NotNull(message = "数据格式不能为空")
+    private Integer dataFormat;
+
+    /**
+     * 认证方式
+     */
+    @NotNull(message = "数据格式不能为空")
+    private Integer authType;
+    /**
+     * 设备厂商
+     */
+    @NotNull(message = "设备厂商不能为空")
+    private Integer vendors;
+
+    /**
+     * 产品标签
+     */
+    @NotBlank(message = "产品标签不能为空")
+    private String tag;
+
+    /**
+     * 备注
+     */
+    private String remark;
+}

+ 56 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/req/IotUrlPara.java

@@ -0,0 +1,56 @@
+package com.middle.platform.manage.biz.domain.req;
+
+import jakarta.validation.constraints.NotNull;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 数据上下行
+ *
+ * @author xucaiqin
+ * @date 2023-12-19 13:43:38
+ */
+@Getter
+@Setter
+public class IotUrlPara {
+    private Long id;
+    /**
+     * 产品id
+     */
+    private Long productId;
+
+    /**
+     * 类别 1-默认 2-自定义
+     */
+    @NotNull(message = "类别不能为空")
+    private Integer category;
+
+    /**
+     * 功能 1-属性上报
+     */
+    @NotNull(message = "功能不能为空")
+    private Integer func;
+
+    /**
+     * 地址
+     */
+    @NotNull(message = "地址不能为空")
+    private String url;
+
+    /**
+     * 设备权限:1发布 2订阅 3发布和订阅
+     */
+    @NotNull(message = "设备权限不能为空")
+    private Integer permission;
+
+    /**
+     * 地址类型 1-mqtt 2-http 3-Coap
+     */
+    @NotNull(message = "地址类型不能为空")
+    private Integer type;
+
+    /**
+     * 备注
+     */
+    private String remark;
+}

+ 14 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/req/ProductPage.java

@@ -0,0 +1,14 @@
+package com.middle.platform.manage.biz.domain.req;
+
+import com.middle.platform.common.modle.BasePara;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author xucaiqin
+ * @date 2023-12-19 14:16:35
+ */
+@Getter
+@Setter
+public class ProductPage extends BasePara {
+}

+ 76 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/domain/vo/IotProductVo.java

@@ -0,0 +1,76 @@
+package com.middle.platform.manage.biz.domain.vo;
+
+import com.middle.platform.mybatis.core.dataobject.BaseVO;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 产品表
+ *
+ * @author xucaiqin
+ * @date 2023-12-19 13:43:38
+ */
+@Getter
+@Setter
+public class IotProductVo extends BaseVO {
+    private Long id;
+
+    /**
+     * 产品编码
+     */
+    private String code;
+
+    /**
+     * 产品名称
+     */
+    private String name;
+
+    /**
+     * 密匙(未知作用)
+     */
+    private String secret;
+
+    /**
+     * 节点类型:1网关、2子设备
+     */
+    private Integer nodeType;
+
+    /**
+     * 联网类型
+     */
+    private Integer networkType;
+
+    /**
+     * 上报协议
+     */
+    private Integer reportProtocol;
+    /**
+     * 设备厂商
+     */
+    private Integer vendors;
+
+    /**
+     * 数据格式
+     */
+    private Integer dataFormat;
+
+    /**
+     * 认证方式
+     */
+    private Integer authType;
+
+    /**
+     * 产品标签
+     */
+    private String tag;
+
+    /**
+     * 设备数
+     */
+    private Integer size;
+
+    /**
+     * 备注
+     */
+    private String remark;
+}

+ 41 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/entity/IotCloud.java

@@ -0,0 +1,41 @@
+package com.middle.platform.manage.biz.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.middle.platform.mybatis.core.dataobject.BaseDO;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 云函数表
+ *
+ * @author xucaiqin
+ * @date 2023-12-19 13:43:38
+ */
+@Getter
+@Setter
+@TableName(value = "iot_cloud")
+public class IotCloud extends BaseDO {
+    @TableId(value = "id", type = IdType.ASSIGN_ID)
+    private Long id;
+
+    /**
+     * 产品id
+     */
+    @TableField(value = "product_id")
+    private Long productId;
+
+    /**
+     * 脚本语言 1-js 2-php
+     */
+    @TableField(value = "lang")
+    private Integer lang;
+
+    /**
+     * 云函数
+     */
+    @TableField(value = "cloud_text")
+    private String cloudText;
+}

+ 35 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/entity/IotCompany.java

@@ -0,0 +1,35 @@
+package com.middle.platform.manage.biz.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.middle.platform.mybatis.core.dataobject.BaseDO;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 企业表
+ *
+ * @author xucaiqin
+ * @date 2023-12-19 13:43:38
+ */
+@Getter
+@Setter
+@TableName(value = "iot_company")
+public class IotCompany extends BaseDO {
+    @TableId(value = "id", type = IdType.ASSIGN_ID)
+    private Long id;
+
+    /**
+     * 企业名称
+     */
+    @TableField(value = "title")
+    private String title;
+
+    /**
+     * 备注
+     */
+    @TableField(value = "remark")
+    private String remark;
+}

+ 98 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/entity/IotDevice.java

@@ -0,0 +1,98 @@
+package com.middle.platform.manage.biz.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.middle.platform.mybatis.core.dataobject.BaseDO;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * 设备表
+ *
+ * @author xucaiqin
+ * @date 2023-12-19 13:43:38
+ */
+@Getter
+@Setter
+@TableName(value = "iot_device")
+public class IotDevice extends BaseDO {
+    @TableId(value = "id", type = IdType.ASSIGN_ID)
+    private Long id;
+
+    /**
+     * 所属产品
+     */
+    @TableField(value = "product_id")
+    private Long productId;
+
+    /**
+     * 设备名称
+     */
+    @TableField(value = "`name`")
+    private String name;
+
+    /**
+     * 设备sn码
+     */
+    @TableField(value = "sn")
+    private String sn;
+
+    /**
+     * 设备guid
+     */
+    @TableField(value = "guid")
+    private String guid;
+
+    /**
+     * 备注名称
+     */
+    @TableField(value = "subtitle")
+    private String subtitle;
+
+    /**
+     * 经度
+     */
+    @TableField(value = "lon")
+    private BigDecimal lon;
+
+    /**
+     * 纬度
+     */
+    @TableField(value = "lat")
+    private BigDecimal lat;
+
+    /**
+     * 所属区域
+     */
+    @TableField(value = "address")
+    private String address;
+
+    /**
+     * 最后在线时间
+     */
+    @TableField(value = "online_time")
+    private LocalDateTime onlineTime;
+
+    /**
+     * 设备状态 1-在线 0-离线
+     */
+    @TableField(value = "`status`")
+    private Integer status;
+
+    /**
+     * 启用状态 1-启用 0-禁用
+     */
+    @TableField(value = "enable_flag")
+    private Integer enableFlag;
+
+    /**
+     * 备注
+     */
+    @TableField(value = "remark")
+    private String remark;
+}

+ 35 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/entity/IotMod.java

@@ -0,0 +1,35 @@
+package com.middle.platform.manage.biz.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.middle.platform.mybatis.core.dataobject.BaseDO;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 物模型表
+ *
+ * @author xucaiqin
+ * @date 2023-12-19 13:43:38
+ */
+@Getter
+@Setter
+@TableName(value = "iot_mod")
+public class IotMod extends BaseDO {
+    @TableId(value = "id", type = IdType.ASSIGN_ID)
+    private Long id;
+
+    /**
+     * 产品id
+     */
+    @TableField(value = "product_id")
+    private Long productId;
+
+    /**
+     * 物模型TSL的JSON
+     */
+    @TableField(value = "tsl_json")
+    private String tslJson;
+}

+ 94 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/entity/IotProduct.java

@@ -0,0 +1,94 @@
+package com.middle.platform.manage.biz.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.middle.platform.mybatis.core.dataobject.BaseDO;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 产品表
+ *
+ * @author xucaiqin
+ * @date 2023-12-19 13:43:38
+ */
+@Getter
+@Setter
+@TableName(value = "iot_product")
+public class IotProduct extends BaseDO {
+    @TableId(value = "id", type = IdType.ASSIGN_ID)
+    private Long id;
+
+    /**
+     * 产品编码
+     */
+    @TableField(value = "code")
+    private String code;
+
+    /**
+     * 产品名称
+     */
+    @TableField(value = "`name`")
+    private String name;
+
+    /**
+     * 密匙(未知作用)
+     */
+    @TableField(value = "secret")
+    private String secret;
+
+    /**
+     * 节点类型:1网关、2子设备
+     */
+    @TableField(value = "node_type")
+    private Integer nodeType;
+
+    /**
+     * 联网类型
+     */
+    @TableField(value = "network_type")
+    private Integer networkType;
+
+    /**
+     * 上报协议
+     */
+    @TableField(value = "report_protocol")
+    private Integer reportProtocol;
+    /**
+     * 设备厂商
+     */
+    @TableField(value = "vendors")
+    private Integer vendors;
+
+    /**
+     * 数据格式
+     */
+    @TableField(value = "data_format")
+    private Integer dataFormat;
+
+    /**
+     * 认证方式
+     */
+    @TableField(value = "auth_type")
+    private Integer authType;
+
+    /**
+     * 产品标签
+     */
+    @TableField(value = "tag")
+    private String tag;
+
+    /**
+     * 设备数
+     */
+    @TableField(value = "`size`")
+    private Integer size;
+
+    /**
+     * 备注
+     */
+    @TableField(value = "remark")
+    private String remark;
+}

+ 53 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/entity/IotProject.java

@@ -0,0 +1,53 @@
+package com.middle.platform.manage.biz.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.middle.platform.mybatis.core.dataobject.BaseDO;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 项目表
+ *
+ * @author xucaiqin
+ * @date 2023-12-19 13:43:38
+ */
+@Getter
+@Setter
+@TableName(value = "iot_project")
+public class IotProject extends BaseDO {
+    @TableId(value = "id", type = IdType.ASSIGN_ID)
+    private Long id;
+
+    /**
+     * 所属企业id
+     */
+    @TableField(value = "company_id")
+    private Long companyId;
+
+    /**
+     * 项目编号
+     */
+    @TableField(value = "code")
+    private String code;
+
+    /**
+     * 项目名称
+     */
+    @TableField(value = "title")
+    private String title;
+
+    /**
+     * 备注
+     */
+    @TableField(value = "remark")
+    private String remark;
+
+    /**
+     * 状态
+     */
+    @TableField(value = "`status`")
+    private Integer status;
+}

+ 38 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/entity/IotProjectDevice.java

@@ -0,0 +1,38 @@
+package com.middle.platform.manage.biz.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.middle.platform.mybatis.core.dataobject.BaseDO;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 产品关联设备表
+ *
+ * @author xucaiqin
+ * @date 2023-12-19 13:43:38
+ */
+@Getter
+@Setter
+@TableName(value = "iot_project_device")
+public class IotProjectDevice extends BaseDO {
+    /**
+     * id
+     */
+    @TableId(value = "id", type = IdType.ASSIGN_ID)
+    private Long id;
+
+    /**
+     * 项目id
+     */
+    @TableField(value = "project_id")
+    private Long projectId;
+
+    /**
+     * 设备id
+     */
+    @TableField(value = "device_id")
+    private Long deviceId;
+}

+ 64 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/entity/IotUrl.java

@@ -0,0 +1,64 @@
+package com.middle.platform.manage.biz.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.middle.platform.mybatis.core.dataobject.BaseDO;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 数据上下行关系表
+* @date 2023-12-19 15:23:22
+* @author xucaiqin
+*/
+@Getter
+@Setter
+@TableName(value = "iot_url")
+public class IotUrl extends BaseDO {
+    @TableId(value = "id", type = IdType.ASSIGN_ID)
+    private Long id;
+
+    /**
+     * 产品id
+     */
+    @TableField(value = "product_id")
+    private Long productId;
+
+    /**
+     * 类别 1-默认 2-自定义
+     */
+    @TableField(value = "category")
+    private Integer category;
+
+    /**
+     * 功能 1-属性上报
+     */
+    @TableField(value = "func")
+    private Integer func;
+
+    /**
+     * 地址
+     */
+    @TableField(value = "url")
+    private String url;
+
+    /**
+     * 设备权限:1发布 2订阅 3发布和订阅
+     */
+    @TableField(value = "permission")
+    private Integer permission;
+
+    /**
+     * 地址类型 1-mqtt 2-http 3-Coap
+     */
+    @TableField(value = "`type`")
+    private Integer type;
+
+    /**
+     * 备注
+     */
+    @TableField(value = "remark")
+    private String remark;
+}

+ 13 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/mapper/IotCloudMapper.java

@@ -0,0 +1,13 @@
+package com.middle.platform.manage.biz.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.middle.platform.manage.biz.entity.IotCloud;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* @date 2023-12-19 13:43:38
+* @author xucaiqin
+*/
+@Mapper
+public interface IotCloudMapper extends BaseMapper<IotCloud> {
+}

+ 6 - 47
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/mapper/IotCompanyMapper.java

@@ -1,54 +1,13 @@
 package com.middle.platform.manage.biz.mapper;
 
-import com.middle.platform.manage.biz.domain.IotCompany;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.middle.platform.manage.biz.entity.IotCompany;
 import org.apache.ibatis.annotations.Mapper;
 
 /**
- * @author Aick Spt
- * @date 2023-12-18 10:09
- */
-
+* @date 2023-12-19 13:43:38
+* @author xucaiqin
+*/
 @Mapper
-public interface IotCompanyMapper {
-    /**
-     * delete by primary key
-     * @param id primaryKey
-     * @return deleteCount
-     */
-    int deleteByPrimaryKey(Long id);
-
-    /**
-     * insert record to table
-     * @param record the record
-     * @return insert count
-     */
-    int insert(IotCompany record);
-
-    /**
-     * insert record to table selective
-     * @param record the record
-     * @return insert count
-     */
-    int insertSelective(IotCompany record);
-
-    /**
-     * select by primary key
-     * @param id primary key
-     * @return object by primary key
-     */
-    IotCompany selectByPrimaryKey(Long id);
-
-    /**
-     * update record selective
-     * @param record the updated record
-     * @return update count
-     */
-    int updateByPrimaryKeySelective(IotCompany record);
-
-    /**
-     * update record
-     * @param record the updated record
-     * @return update count
-     */
-    int updateByPrimaryKey(IotCompany record);
+public interface IotCompanyMapper extends BaseMapper<IotCompany> {
 }

+ 11 - 50
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/mapper/IotDeviceMapper.java

@@ -1,59 +1,20 @@
 package com.middle.platform.manage.biz.mapper;
 
-import com.middle.platform.manage.biz.domain.IotDevice;
-import com.middle.platform.manage.biz.domain.vo.req.IotDeviceVo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.middle.platform.manage.biz.entity.IotDevice;
 import org.apache.ibatis.annotations.Mapper;
 
-import java.util.List;
-
 /**
- * @author Aick Spt
- * @date 2023-12-18 10:09
+ * @author xucaiqin
+ * @date 2023-12-19 13:43:38
  */
-
 @Mapper
-public interface IotDeviceMapper {
-    /**
-     * delete by primary key
-     * @param id primaryKey
-     * @return deleteCount
-     */
-    int deleteByPrimaryKey(Long id);
-
-    /**
-     * insert record to table
-     * @param record the record
-     * @return insert count
-     */
-    int insert(IotDevice record);
-
-    /**
-     * insert record to table selective
-     * @param record the record
-     * @return insert count
-     */
-    int insertSelective(IotDevice record);
-
-    /**
-     * select by primary key
-     * @param id primary key
-     * @return object by primary key
-     */
-    IotDevice selectByPrimaryKey(Long id);
-
+public interface IotDeviceMapper extends BaseMapper<IotDevice> {
     /**
-     * update record selective
-     * @param record the updated record
-     * @return update count
+     * 统计产品下的设备数量
+     *
+     * @param id 产品id
+     * @return
      */
-    int updateByPrimaryKeySelective(IotDevice record);
-
-    /**
-     * update record
-     * @param record the updated record
-     * @return update count
-     */
-    int updateByPrimaryKey(IotDevice record);
-
-    List<IotDevice> select(IotDeviceVo params);
-}
+    Long queryByProduct(Long id);
+}

+ 6 - 47
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/mapper/IotModMapper.java

@@ -1,54 +1,13 @@
 package com.middle.platform.manage.biz.mapper;
 
-import com.middle.platform.manage.biz.domain.IotMod;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.middle.platform.manage.biz.entity.IotMod;
 import org.apache.ibatis.annotations.Mapper;
 
 /**
- * @author Aick Spt
- * @date 2023-12-18 10:09
- */
-
+* @date 2023-12-19 13:43:38
+* @author xucaiqin
+*/
 @Mapper
-public interface IotModMapper {
-    /**
-     * delete by primary key
-     * @param id primaryKey
-     * @return deleteCount
-     */
-    int deleteByPrimaryKey(Long id);
-
-    /**
-     * insert record to table
-     * @param record the record
-     * @return insert count
-     */
-    int insert(IotMod record);
-
-    /**
-     * insert record to table selective
-     * @param record the record
-     * @return insert count
-     */
-    int insertSelective(IotMod record);
-
-    /**
-     * select by primary key
-     * @param id primary key
-     * @return object by primary key
-     */
-    IotMod selectByPrimaryKey(Long id);
-
-    /**
-     * update record selective
-     * @param record the updated record
-     * @return update count
-     */
-    int updateByPrimaryKeySelective(IotMod record);
-
-    /**
-     * update record
-     * @param record the updated record
-     * @return update count
-     */
-    int updateByPrimaryKey(IotMod record);
+public interface IotModMapper extends BaseMapper<IotMod> {
 }

+ 15 - 45
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/mapper/IotProductMapper.java

@@ -1,54 +1,24 @@
 package com.middle.platform.manage.biz.mapper;
 
-import com.middle.platform.manage.biz.domain.IotProduct;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.middle.platform.manage.biz.domain.req.ProductPage;
+import com.middle.platform.manage.biz.domain.vo.IotProductVo;
+import com.middle.platform.manage.biz.entity.IotProduct;
 import org.apache.ibatis.annotations.Mapper;
 
+import java.util.List;
+
 /**
- * @author Aick Spt
- * @date 2023-12-18 10:09
+ * @author xucaiqin
+ * @date 2023-12-19 13:43:38
  */
-
 @Mapper
-public interface IotProductMapper {
-    /**
-     * delete by primary key
-     * @param id primaryKey
-     * @return deleteCount
-     */
-    int deleteByPrimaryKey(Long id);
-
-    /**
-     * insert record to table
-     * @param record the record
-     * @return insert count
-     */
-    int insert(IotProduct record);
-
-    /**
-     * insert record to table selective
-     * @param record the record
-     * @return insert count
-     */
-    int insertSelective(IotProduct record);
-
-    /**
-     * select by primary key
-     * @param id primary key
-     * @return object by primary key
-     */
-    IotProduct selectByPrimaryKey(Long id);
-
-    /**
-     * update record selective
-     * @param record the updated record
-     * @return update count
-     */
-    int updateByPrimaryKeySelective(IotProduct record);
-
+public interface IotProductMapper extends BaseMapper<IotProduct> {
     /**
-     * update record
-     * @param record the updated record
-     * @return update count
+     * 分页查询
+     *
+     * @param devicePage
+     * @return
      */
-    int updateByPrimaryKey(IotProduct record);
-}
+    List<IotProductVo> pageQuery(ProductPage devicePage);
+}

+ 6 - 47
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/mapper/IotProjectDeviceMapper.java

@@ -1,54 +1,13 @@
 package com.middle.platform.manage.biz.mapper;
 
-import com.middle.platform.manage.biz.domain.IotProjectDevice;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.middle.platform.manage.biz.entity.IotProjectDevice;
 import org.apache.ibatis.annotations.Mapper;
 
 /**
- * @author Aick Spt
- * @date 2023-12-18 10:09
- */
-
+* @date 2023-12-19 13:43:38
+* @author xucaiqin
+*/
 @Mapper
-public interface IotProjectDeviceMapper {
-    /**
-     * delete by primary key
-     * @param id primaryKey
-     * @return deleteCount
-     */
-    int deleteByPrimaryKey(Long id);
-
-    /**
-     * insert record to table
-     * @param record the record
-     * @return insert count
-     */
-    int insert(IotProjectDevice record);
-
-    /**
-     * insert record to table selective
-     * @param record the record
-     * @return insert count
-     */
-    int insertSelective(IotProjectDevice record);
-
-    /**
-     * select by primary key
-     * @param id primary key
-     * @return object by primary key
-     */
-    IotProjectDevice selectByPrimaryKey(Long id);
-
-    /**
-     * update record selective
-     * @param record the updated record
-     * @return update count
-     */
-    int updateByPrimaryKeySelective(IotProjectDevice record);
-
-    /**
-     * update record
-     * @param record the updated record
-     * @return update count
-     */
-    int updateByPrimaryKey(IotProjectDevice record);
+public interface IotProjectDeviceMapper extends BaseMapper<IotProjectDevice> {
 }

+ 6 - 47
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/mapper/IotProjectMapper.java

@@ -1,54 +1,13 @@
 package com.middle.platform.manage.biz.mapper;
 
-import com.middle.platform.manage.biz.domain.IotProject;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.middle.platform.manage.biz.entity.IotProject;
 import org.apache.ibatis.annotations.Mapper;
 
 /**
- * @author Aick Spt
- * @date 2023-12-18 10:09
- */
-
+* @date 2023-12-19 13:43:38
+* @author xucaiqin
+*/
 @Mapper
-public interface IotProjectMapper {
-    /**
-     * delete by primary key
-     * @param id primaryKey
-     * @return deleteCount
-     */
-    int deleteByPrimaryKey(Long id);
-
-    /**
-     * insert record to table
-     * @param record the record
-     * @return insert count
-     */
-    int insert(IotProject record);
-
-    /**
-     * insert record to table selective
-     * @param record the record
-     * @return insert count
-     */
-    int insertSelective(IotProject record);
-
-    /**
-     * select by primary key
-     * @param id primary key
-     * @return object by primary key
-     */
-    IotProject selectByPrimaryKey(Long id);
-
-    /**
-     * update record selective
-     * @param record the updated record
-     * @return update count
-     */
-    int updateByPrimaryKeySelective(IotProject record);
-
-    /**
-     * update record
-     * @param record the updated record
-     * @return update count
-     */
-    int updateByPrimaryKey(IotProject record);
+public interface IotProjectMapper extends BaseMapper<IotProject> {
 }

+ 6 - 47
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/mapper/IotUrlMapper.java

@@ -1,54 +1,13 @@
 package com.middle.platform.manage.biz.mapper;
 
-import com.middle.platform.manage.biz.domain.IotUrl;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.middle.platform.manage.biz.entity.IotUrl;
 import org.apache.ibatis.annotations.Mapper;
 
 /**
- * @author Aick Spt
- * @date 2023-12-18 10:09
- */
-
+* @date 2023-12-19 13:43:38
+* @author xucaiqin
+*/
 @Mapper
-public interface IotUrlMapper {
-    /**
-     * delete by primary key
-     * @param id primaryKey
-     * @return deleteCount
-     */
-    int deleteByPrimaryKey(Long id);
-
-    /**
-     * insert record to table
-     * @param record the record
-     * @return insert count
-     */
-    int insert(IotUrl record);
-
-    /**
-     * insert record to table selective
-     * @param record the record
-     * @return insert count
-     */
-    int insertSelective(IotUrl record);
-
-    /**
-     * select by primary key
-     * @param id primary key
-     * @return object by primary key
-     */
-    IotUrl selectByPrimaryKey(Long id);
-
-    /**
-     * update record selective
-     * @param record the updated record
-     * @return update count
-     */
-    int updateByPrimaryKeySelective(IotUrl record);
-
-    /**
-     * update record
-     * @param record the updated record
-     * @return update count
-     */
-    int updateByPrimaryKey(IotUrl record);
+public interface IotUrlMapper extends BaseMapper<IotUrl> {
 }

+ 77 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotCloudService.java

@@ -0,0 +1,77 @@
+package com.middle.platform.manage.biz.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.middle.platform.common.exception.BusinessException;
+import com.middle.platform.manage.biz.domain.req.IotCloudPara;
+import com.middle.platform.manage.biz.domain.req.IotCloudTest;
+import com.middle.platform.manage.biz.entity.IotCloud;
+import com.middle.platform.manage.biz.mapper.IotCloudMapper;
+import lombok.RequiredArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+
+import java.util.Objects;
+
+/**
+ * @author xucaiqin
+ * @date 2023-12-19 13:43:38
+ */
+@Service
+@RequiredArgsConstructor
+public class IotCloudService {
+    private final IotCloudMapper iotCloudMapper;
+
+    /**
+     * 新增或修改云函数
+     *
+     * @param iotCloudPara
+     * @return
+     */
+    public Object save(IotCloudPara iotCloudPara) {
+        IotCloud query = query(iotCloudPara.getProductId());
+        //更新云函数
+        if (Objects.nonNull(query)) {
+            query.setLang(iotCloudPara.getLang());
+            query.setCloudText(iotCloudPara.getCloudText());
+            iotCloudMapper.updateById(query);
+            return true;
+        }
+        //新增云函数
+        IotCloud iotCloud = new IotCloud();
+        iotCloud.setProductId(iotCloudPara.getProductId());
+        iotCloud.setLang(iotCloudPara.getLang());
+        iotCloud.setCloudText(iotCloudPara.getCloudText());
+        iotCloudMapper.insert(iotCloud);
+        return true;
+    }
+
+    /**
+     * 查询产品关联的云函数
+     *
+     * @param productId 产品id
+     * @return
+     */
+    private IotCloud query(Long productId) {
+        return iotCloudMapper.selectOne(new LambdaQueryWrapper<IotCloud>()
+                .eq(IotCloud::getProductId, productId).last("limit 1"));
+    }
+
+    /**
+     * 测试云函数
+     *
+     * @param iotCloudTest
+     * @return
+     */
+    public Object test(IotCloudTest iotCloudTest) {
+        IotCloud iotCloud = iotCloudMapper.selectOne(new LambdaQueryWrapper<IotCloud>()
+                .eq(IotCloud::getProductId, iotCloudTest.getProductId()).last("limit 1"));
+        if (Objects.isNull(iotCloud)) {
+            throw new BusinessException("云函数不存在");
+        }
+        if (StringUtils.isBlank(iotCloud.getCloudText())) {
+            throw new BusinessException("云函数为空");
+        }
+        //todo 云函数测试
+        return null;
+    }
+}

+ 14 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotCompanyService.java

@@ -0,0 +1,14 @@
+package com.middle.platform.manage.biz.service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.middle.platform.manage.biz.entity.IotCompany;
+import com.middle.platform.manage.biz.mapper.IotCompanyMapper;
+import org.springframework.stereotype.Service;
+/**
+* @date 2023-12-19 13:43:38
+* @author xucaiqin
+*/
+@Service
+public class IotCompanyService extends ServiceImpl<IotCompanyMapper, IotCompany> {
+
+}

+ 0 - 51
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotCompanyServiceImpl.java

@@ -1,51 +0,0 @@
-package com.middle.platform.manage.biz.service;
-
-import com.middle.platform.manage.biz.domain.IotCompany;
-import com.middle.platform.manage.biz.mapper.IotCompanyMapper;
-import com.middle.platform.manage.biz.service.impl.IotCompanyService;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-/**
- * @author Aick Spt
- * @date 2023-12-18 10:08
- */
-@Slf4j
-@Service
-@RequiredArgsConstructor
-public class IotCompanyServiceImpl implements IotCompanyService {
-
-    private final IotCompanyMapper iotCompanyMapper;
-
-    @Override
-    public int deleteByPrimaryKey(Long id) {
-        return iotCompanyMapper.deleteByPrimaryKey(id);
-    }
-
-    @Override
-    public int insert(IotCompany record) {
-        return iotCompanyMapper.insert(record);
-    }
-
-    @Override
-    public int insertSelective(IotCompany record) {
-        return iotCompanyMapper.insertSelective(record);
-    }
-
-    @Override
-    public IotCompany selectByPrimaryKey(Long id) {
-        return iotCompanyMapper.selectByPrimaryKey(id);
-    }
-
-    @Override
-    public int updateByPrimaryKeySelective(IotCompany record) {
-        return iotCompanyMapper.updateByPrimaryKeySelective(record);
-    }
-
-    @Override
-    public int updateByPrimaryKey(IotCompany record) {
-        return iotCompanyMapper.updateByPrimaryKey(record);
-    }
-
-}

+ 42 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotDeviceService.java

@@ -0,0 +1,42 @@
+package com.middle.platform.manage.biz.service;
+
+import com.middle.platform.manage.biz.domain.req.DevicePage;
+import com.middle.platform.manage.biz.domain.req.IotDevicePara;
+import com.middle.platform.manage.biz.mapper.IotDeviceMapper;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author xucaiqin
+ * @date 2023-12-19 13:43:38
+ */
+@Service
+@RequiredArgsConstructor
+public class IotDeviceService {
+    private final IotDeviceMapper iotDeviceMapper;
+
+    /**
+     * 设备分页查询
+     *
+     * @param devicePage
+     * @return
+     */
+    public Object pageQuery(DevicePage devicePage) {
+        return null;
+    }
+
+    public Object save(IotDevicePara iotDevicePara) {
+        return null;
+    }
+
+    /**
+     * 删除设备
+     *
+     * @param id
+     * @return
+     */
+    public Object remove(Long id) {
+        iotDeviceMapper.deleteById(id);
+        return true;
+    }
+}

+ 0 - 60
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotDeviceServiceImpl.java

@@ -1,60 +0,0 @@
-package com.middle.platform.manage.biz.service;
-
-import com.middle.platform.manage.biz.domain.IotDevice;
-import com.middle.platform.manage.biz.domain.vo.req.IotDeviceVo;
-import com.middle.platform.manage.biz.mapper.IotDeviceMapper;
-import com.middle.platform.manage.biz.service.impl.IotDeviceService;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-
-/**
- * @author Aick Spt
- * @date 2023-12-18 10:08
- */
-@Slf4j
-@Service
-@RequiredArgsConstructor
-public class IotDeviceServiceImpl implements IotDeviceService {
-
-    private final IotDeviceMapper iotDeviceMapper;
-
-    @Override
-    public int deleteByPrimaryKey(Long id) {
-        return iotDeviceMapper.deleteByPrimaryKey(id);
-    }
-
-    @Override
-    public int insert(IotDevice record) {
-        return iotDeviceMapper.insert(record);
-    }
-
-    @Override
-    public int insertSelective(IotDevice record) {
-        return iotDeviceMapper.insertSelective(record);
-    }
-
-    @Override
-    public IotDevice selectByPrimaryKey(Long id) {
-        return iotDeviceMapper.selectByPrimaryKey(id);
-    }
-
-    @Override
-    public int updateByPrimaryKeySelective(IotDevice record) {
-        return iotDeviceMapper.updateByPrimaryKeySelective(record);
-    }
-
-    @Override
-    public int updateByPrimaryKey(IotDevice record) {
-        return iotDeviceMapper.updateByPrimaryKey(record);
-    }
-
-    @Override
-    public List<IotDevice> select(IotDeviceVo params) {
-        return iotDeviceMapper.select(params);
-    }
-
-}

+ 46 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotModService.java

@@ -0,0 +1,46 @@
+package com.middle.platform.manage.biz.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.middle.platform.manage.biz.domain.req.IotModPara;
+import com.middle.platform.manage.biz.entity.IotMod;
+import com.middle.platform.manage.biz.mapper.IotModMapper;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.util.Objects;
+
+/**
+ * @author xucaiqin
+ * @date 2023-12-19 13:43:38
+ */
+@Service
+@RequiredArgsConstructor
+public class IotModService {
+    private final IotModMapper iotModMapper;
+
+    /**
+     * 保存物模型数据
+     *
+     * @param iotModPara
+     * @return
+     */
+    public Object save(IotModPara iotModPara) {
+        IotMod query = query(iotModPara.getProductId());
+        //修改物模型
+        if (Objects.nonNull(query)) {
+            query.setTslJson(iotModPara.getTslJson());
+            iotModMapper.updateById(query);
+            return true;
+        }
+        //新增物模型
+        IotMod iotMod = new IotMod();
+        iotMod.setProductId(iotModPara.getProductId());
+        iotMod.setTslJson(iotModPara.getTslJson());
+        iotModMapper.insert(iotMod);
+        return true;
+    }
+
+    private IotMod query(Long productId) {
+        return iotModMapper.selectOne(new LambdaQueryWrapper<IotMod>().eq(IotMod::getProductId, productId).last("limit 1"));
+    }
+}

+ 0 - 51
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotModServiceImpl.java

@@ -1,51 +0,0 @@
-package com.middle.platform.manage.biz.service;
-
-import com.middle.platform.manage.biz.domain.IotMod;
-import com.middle.platform.manage.biz.mapper.IotModMapper;
-import com.middle.platform.manage.biz.service.impl.IotModService;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-/**
- * @author Aick Spt
- * @date 2023-12-18 10:08
- */
-@Slf4j
-@Service
-@RequiredArgsConstructor
-public class IotModServiceImpl implements IotModService {
-
-    private final IotModMapper iotModMapper;
-
-    @Override
-    public int deleteByPrimaryKey(Long id) {
-        return iotModMapper.deleteByPrimaryKey(id);
-    }
-
-    @Override
-    public int insert(IotMod record) {
-        return iotModMapper.insert(record);
-    }
-
-    @Override
-    public int insertSelective(IotMod record) {
-        return iotModMapper.insertSelective(record);
-    }
-
-    @Override
-    public IotMod selectByPrimaryKey(Long id) {
-        return iotModMapper.selectByPrimaryKey(id);
-    }
-
-    @Override
-    public int updateByPrimaryKeySelective(IotMod record) {
-        return iotModMapper.updateByPrimaryKeySelective(record);
-    }
-
-    @Override
-    public int updateByPrimaryKey(IotMod record) {
-        return iotModMapper.updateByPrimaryKey(record);
-    }
-
-}

+ 81 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotProductService.java

@@ -0,0 +1,81 @@
+package com.middle.platform.manage.biz.service;
+
+import com.github.pagehelper.PageHelper;
+import com.middle.platform.common.exception.BusinessException;
+import com.middle.platform.common.utils.PageRes;
+import com.middle.platform.manage.biz.domain.req.IotProductPara;
+import com.middle.platform.manage.biz.domain.req.ProductPage;
+import com.middle.platform.manage.biz.domain.vo.IotProductVo;
+import com.middle.platform.manage.biz.entity.IotProduct;
+import com.middle.platform.manage.biz.mapper.IotDeviceMapper;
+import com.middle.platform.manage.biz.mapper.IotProductMapper;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author xucaiqin
+ * @date 2023-12-19 13:43:38
+ */
+@Service
+@RequiredArgsConstructor
+public class IotProductService {
+    private final IotProductMapper iotProductMapper;
+    private final IotDeviceMapper iotDeviceMapper;
+
+    /**
+     * 分页查询产品数据
+     *
+     * @param devicePage
+     * @return
+     */
+    public Object pageQuery(ProductPage devicePage) {
+        PageHelper.startPage(devicePage.getPage(), devicePage.getPageSize());
+        List<IotProductVo> iotProductVos = iotProductMapper.pageQuery(devicePage);
+        return new PageRes<>(iotProductVos);
+    }
+
+    /**
+     * 新增产品
+     *
+     * @param iotProductPara
+     * @return
+     */
+    public Object save(IotProductPara iotProductPara) {
+        IotProduct iotProduct = new IotProduct();
+        iotProduct.setCode(iotProductPara.getCode());
+        iotProduct.setName(iotProductPara.getName());
+        iotProduct.setSecret(iotProductPara.getSecret());
+        iotProduct.setNodeType(iotProductPara.getNodeType());
+        iotProduct.setNetworkType(iotProductPara.getNetworkType());
+        iotProduct.setReportProtocol(iotProductPara.getReportProtocol());
+        iotProduct.setVendors(iotProductPara.getVendors());
+        iotProduct.setDataFormat(iotProductPara.getDataFormat());
+        iotProduct.setAuthType(iotProductPara.getAuthType());
+        iotProduct.setTag(iotProductPara.getTag());
+        iotProduct.setSize(0);
+        iotProduct.setRemark(iotProductPara.getRemark());
+        iotProductMapper.insert(iotProduct);
+        return null;
+    }
+
+    /**
+     * 删除产品
+     *
+     * @param id 产品id
+     * @return
+     */
+    public Object remove(Long id) {
+        delProductCheck(id);
+        iotProductMapper.deleteById(id);
+        return true;
+    }
+
+    private void delProductCheck(Long id) {
+        Long aLong = iotDeviceMapper.queryByProduct(id);
+        if (aLong > 0) {
+            throw new BusinessException("产品下存在关联设备,不允许删除");
+        }
+    }
+}

+ 0 - 51
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotProductServiceImpl.java

@@ -1,51 +0,0 @@
-package com.middle.platform.manage.biz.service;
-
-import com.middle.platform.manage.biz.domain.IotProduct;
-import com.middle.platform.manage.biz.mapper.IotProductMapper;
-import com.middle.platform.manage.biz.service.impl.IotProductService;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-/**
- * @author Aick Spt
- * @date 2023-12-18 10:08
- */
-@Slf4j
-@Service
-@RequiredArgsConstructor
-public class IotProductServiceImpl implements IotProductService {
-
-    private final IotProductMapper iotProductMapper;
-
-    @Override
-    public int deleteByPrimaryKey(Long id) {
-        return iotProductMapper.deleteByPrimaryKey(id);
-    }
-
-    @Override
-    public int insert(IotProduct record) {
-        return iotProductMapper.insert(record);
-    }
-
-    @Override
-    public int insertSelective(IotProduct record) {
-        return iotProductMapper.insertSelective(record);
-    }
-
-    @Override
-    public IotProduct selectByPrimaryKey(Long id) {
-        return iotProductMapper.selectByPrimaryKey(id);
-    }
-
-    @Override
-    public int updateByPrimaryKeySelective(IotProduct record) {
-        return iotProductMapper.updateByPrimaryKeySelective(record);
-    }
-
-    @Override
-    public int updateByPrimaryKey(IotProduct record) {
-        return iotProductMapper.updateByPrimaryKey(record);
-    }
-
-}

+ 14 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotProjectDeviceService.java

@@ -0,0 +1,14 @@
+package com.middle.platform.manage.biz.service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.middle.platform.manage.biz.entity.IotProjectDevice;
+import com.middle.platform.manage.biz.mapper.IotProjectDeviceMapper;
+import org.springframework.stereotype.Service;
+/**
+* @date 2023-12-19 13:43:38
+* @author xucaiqin
+*/
+@Service
+public class IotProjectDeviceService extends ServiceImpl<IotProjectDeviceMapper, IotProjectDevice> {
+
+}

+ 0 - 51
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotProjectDeviceServiceImpl.java

@@ -1,51 +0,0 @@
-package com.middle.platform.manage.biz.service;
-
-import com.middle.platform.manage.biz.domain.IotProjectDevice;
-import com.middle.platform.manage.biz.mapper.IotProjectDeviceMapper;
-import com.middle.platform.manage.biz.service.impl.IotProjectDeviceService;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-/**
- * @author Aick Spt
- * @date 2023-12-18 10:08
- */
-@Slf4j
-@Service
-@RequiredArgsConstructor
-public class IotProjectDeviceServiceImpl implements IotProjectDeviceService {
-
-    private final IotProjectDeviceMapper iotProjectDeviceMapper;
-
-    @Override
-    public int deleteByPrimaryKey(Long id) {
-        return iotProjectDeviceMapper.deleteByPrimaryKey(id);
-    }
-
-    @Override
-    public int insert(IotProjectDevice record) {
-        return iotProjectDeviceMapper.insert(record);
-    }
-
-    @Override
-    public int insertSelective(IotProjectDevice record) {
-        return iotProjectDeviceMapper.insertSelective(record);
-    }
-
-    @Override
-    public IotProjectDevice selectByPrimaryKey(Long id) {
-        return iotProjectDeviceMapper.selectByPrimaryKey(id);
-    }
-
-    @Override
-    public int updateByPrimaryKeySelective(IotProjectDevice record) {
-        return iotProjectDeviceMapper.updateByPrimaryKeySelective(record);
-    }
-
-    @Override
-    public int updateByPrimaryKey(IotProjectDevice record) {
-        return iotProjectDeviceMapper.updateByPrimaryKey(record);
-    }
-
-}

+ 14 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotProjectService.java

@@ -0,0 +1,14 @@
+package com.middle.platform.manage.biz.service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.middle.platform.manage.biz.entity.IotProject;
+import com.middle.platform.manage.biz.mapper.IotProjectMapper;
+import org.springframework.stereotype.Service;
+/**
+* @date 2023-12-19 13:43:38
+* @author xucaiqin
+*/
+@Service
+public class IotProjectService extends ServiceImpl<IotProjectMapper, IotProject> {
+
+}

+ 0 - 51
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotProjectServiceImpl.java

@@ -1,51 +0,0 @@
-package com.middle.platform.manage.biz.service;
-
-import com.middle.platform.manage.biz.domain.IotProject;
-import com.middle.platform.manage.biz.mapper.IotProjectMapper;
-import com.middle.platform.manage.biz.service.impl.IotProjectService;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-/**
- * @author Aick Spt
- * @date 2023-12-18 10:08
- */
-@Slf4j
-@Service
-@RequiredArgsConstructor
-public class IotProjectServiceImpl implements IotProjectService {
-
-    private final IotProjectMapper iotProjectMapper;
-
-    @Override
-    public int deleteByPrimaryKey(Long id) {
-        return iotProjectMapper.deleteByPrimaryKey(id);
-    }
-
-    @Override
-    public int insert(IotProject record) {
-        return iotProjectMapper.insert(record);
-    }
-
-    @Override
-    public int insertSelective(IotProject record) {
-        return iotProjectMapper.insertSelective(record);
-    }
-
-    @Override
-    public IotProject selectByPrimaryKey(Long id) {
-        return iotProjectMapper.selectByPrimaryKey(id);
-    }
-
-    @Override
-    public int updateByPrimaryKeySelective(IotProject record) {
-        return iotProjectMapper.updateByPrimaryKeySelective(record);
-    }
-
-    @Override
-    public int updateByPrimaryKey(IotProject record) {
-        return iotProjectMapper.updateByPrimaryKey(record);
-    }
-
-}

+ 75 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotUrlService.java

@@ -0,0 +1,75 @@
+package com.middle.platform.manage.biz.service;
+
+import com.middle.platform.common.exception.BusinessException;
+import com.middle.platform.manage.biz.domain.req.IotUrlPara;
+import com.middle.platform.manage.biz.entity.IotUrl;
+import com.middle.platform.manage.biz.mapper.IotUrlMapper;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.util.Objects;
+
+/**
+ * @author xucaiqin
+ * @date 2023-12-19 13:43:38
+ */
+@Service
+@RequiredArgsConstructor
+public class IotUrlService {
+    private final IotUrlMapper iotUrlMapper;
+
+    /**
+     * 新增topic
+     *
+     * @param iotUrlPara
+     * @return
+     */
+    public Object saveUrl(IotUrlPara iotUrlPara) {
+        if (Objects.isNull(iotUrlPara.getProductId())) {
+            throw new BusinessException("产品id不能为空");
+        }
+        IotUrl iotUrl = new IotUrl();
+        iotUrl.setProductId(iotUrlPara.getProductId());
+        iotUrl.setCategory(iotUrlPara.getCategory());
+        iotUrl.setFunc(iotUrlPara.getFunc());
+        iotUrl.setUrl(iotUrlPara.getUrl());
+        iotUrl.setPermission(iotUrlPara.getPermission());
+        iotUrl.setType(iotUrlPara.getType());
+        iotUrl.setRemark(iotUrlPara.getRemark());
+        iotUrlMapper.insert(iotUrl);
+        return true;
+    }
+
+    /**
+     * 修改topic
+     *
+     * @param iotUrlPara
+     * @return
+     */
+    public Object update(IotUrlPara iotUrlPara) {
+        if (Objects.isNull(iotUrlPara.getId())) {
+            throw new BusinessException("id不能为空");
+        }
+        IotUrl iotUrl = new IotUrl();
+        iotUrl.setId(iotUrlPara.getId());
+        iotUrl.setCategory(iotUrlPara.getCategory());
+        iotUrl.setFunc(iotUrlPara.getFunc());
+        iotUrl.setUrl(iotUrlPara.getUrl());
+        iotUrl.setPermission(iotUrlPara.getPermission());
+        iotUrl.setType(iotUrlPara.getType());
+        iotUrl.setRemark(iotUrlPara.getRemark());
+        iotUrlMapper.updateById(iotUrl);
+        return true;
+    }
+
+    /**
+     * 删除地址
+     *
+     * @param id
+     * @return
+     */
+    public Object remove(Long id) {
+        iotUrlMapper.deleteById(id);
+        return true;
+    }
+}

+ 0 - 51
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotUrlServiceImpl.java

@@ -1,51 +0,0 @@
-package com.middle.platform.manage.biz.service;
-
-import com.middle.platform.manage.biz.domain.IotUrl;
-import com.middle.platform.manage.biz.mapper.IotUrlMapper;
-import com.middle.platform.manage.biz.service.impl.IotUrlService;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-/**
- * @author Aick Spt
- * @date 2023-12-18 10:08
- */
-@Slf4j
-@Service
-@RequiredArgsConstructor
-public class IotUrlServiceImpl implements IotUrlService {
-
-    private final IotUrlMapper iotUrlMapper;
-
-    @Override
-    public int deleteByPrimaryKey(Long id) {
-        return iotUrlMapper.deleteByPrimaryKey(id);
-    }
-
-    @Override
-    public int insert(IotUrl record) {
-        return iotUrlMapper.insert(record);
-    }
-
-    @Override
-    public int insertSelective(IotUrl record) {
-        return iotUrlMapper.insertSelective(record);
-    }
-
-    @Override
-    public IotUrl selectByPrimaryKey(Long id) {
-        return iotUrlMapper.selectByPrimaryKey(id);
-    }
-
-    @Override
-    public int updateByPrimaryKeySelective(IotUrl record) {
-        return iotUrlMapper.updateByPrimaryKeySelective(record);
-    }
-
-    @Override
-    public int updateByPrimaryKey(IotUrl record) {
-        return iotUrlMapper.updateByPrimaryKey(record);
-    }
-
-}

+ 0 - 24
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/impl/IotCompanyService.java

@@ -1,24 +0,0 @@
-package com.middle.platform.manage.biz.service.impl;
-
-import com.middle.platform.manage.biz.domain.IotCompany;
-    /**
- * @author Aick Spt
- * @date 2023-12-18 10:08
- */
-
-public interface IotCompanyService{
-
-
-    int deleteByPrimaryKey(Long id);
-
-    int insert(IotCompany record);
-
-    int insertSelective(IotCompany record);
-
-    IotCompany selectByPrimaryKey(Long id);
-
-    int updateByPrimaryKeySelective(IotCompany record);
-
-    int updateByPrimaryKey(IotCompany record);
-
-}

+ 0 - 29
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/impl/IotDeviceService.java

@@ -1,29 +0,0 @@
-package com.middle.platform.manage.biz.service.impl;
-
-import com.middle.platform.manage.biz.domain.IotDevice;
-import com.middle.platform.manage.biz.domain.vo.req.IotDeviceVo;
-
-import java.util.List;
-
-/**
- * @author Aick Spt
- * @date 2023-12-18 10:08
- */
-
-public interface IotDeviceService{
-
-
-    int deleteByPrimaryKey(Long id);
-
-    int insert(IotDevice record);
-
-    int insertSelective(IotDevice record);
-
-    IotDevice selectByPrimaryKey(Long id);
-
-    int updateByPrimaryKeySelective(IotDevice record);
-
-    int updateByPrimaryKey(IotDevice record);
-
-        List<IotDevice> select(IotDeviceVo params);
-    }

+ 0 - 24
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/impl/IotModService.java

@@ -1,24 +0,0 @@
-package com.middle.platform.manage.biz.service.impl;
-
-import com.middle.platform.manage.biz.domain.IotMod;
-    /**
- * @author Aick Spt
- * @date 2023-12-18 10:08
- */
-
-public interface IotModService{
-
-
-    int deleteByPrimaryKey(Long id);
-
-    int insert(IotMod record);
-
-    int insertSelective(IotMod record);
-
-    IotMod selectByPrimaryKey(Long id);
-
-    int updateByPrimaryKeySelective(IotMod record);
-
-    int updateByPrimaryKey(IotMod record);
-
-}

+ 0 - 24
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/impl/IotProductService.java

@@ -1,24 +0,0 @@
-package com.middle.platform.manage.biz.service.impl;
-
-import com.middle.platform.manage.biz.domain.IotProduct;
-    /**
- * @author Aick Spt
- * @date 2023-12-18 10:08
- */
-
-public interface IotProductService{
-
-
-    int deleteByPrimaryKey(Long id);
-
-    int insert(IotProduct record);
-
-    int insertSelective(IotProduct record);
-
-    IotProduct selectByPrimaryKey(Long id);
-
-    int updateByPrimaryKeySelective(IotProduct record);
-
-    int updateByPrimaryKey(IotProduct record);
-
-}

+ 0 - 24
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/impl/IotProjectDeviceService.java

@@ -1,24 +0,0 @@
-package com.middle.platform.manage.biz.service.impl;
-
-import com.middle.platform.manage.biz.domain.IotProjectDevice;
-    /**
- * @author Aick Spt
- * @date 2023-12-18 10:08
- */
-
-public interface IotProjectDeviceService{
-
-
-    int deleteByPrimaryKey(Long id);
-
-    int insert(IotProjectDevice record);
-
-    int insertSelective(IotProjectDevice record);
-
-    IotProjectDevice selectByPrimaryKey(Long id);
-
-    int updateByPrimaryKeySelective(IotProjectDevice record);
-
-    int updateByPrimaryKey(IotProjectDevice record);
-
-}

+ 0 - 24
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/impl/IotProjectService.java

@@ -1,24 +0,0 @@
-package com.middle.platform.manage.biz.service.impl;
-
-import com.middle.platform.manage.biz.domain.IotProject;
-    /**
- * @author Aick Spt
- * @date 2023-12-18 10:08
- */
-
-public interface IotProjectService{
-
-
-    int deleteByPrimaryKey(Long id);
-
-    int insert(IotProject record);
-
-    int insertSelective(IotProject record);
-
-    IotProject selectByPrimaryKey(Long id);
-
-    int updateByPrimaryKeySelective(IotProject record);
-
-    int updateByPrimaryKey(IotProject record);
-
-}

+ 0 - 24
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/impl/IotUrlService.java

@@ -1,24 +0,0 @@
-package com.middle.platform.manage.biz.service.impl;
-
-import com.middle.platform.manage.biz.domain.IotUrl;
-    /**
- * @author Aick Spt
- * @date 2023-12-18 10:08
- */
-
-public interface IotUrlService{
-
-
-    int deleteByPrimaryKey(Long id);
-
-    int insert(IotUrl record);
-
-    int insertSelective(IotUrl record);
-
-    IotUrl selectByPrimaryKey(Long id);
-
-    int updateByPrimaryKeySelective(IotUrl record);
-
-    int updateByPrimaryKey(IotUrl record);
-
-}

+ 23 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/resources/mapper/IotCloudMapper.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.middle.platform.manage.biz.mapper.IotCloudMapper">
+  <resultMap id="BaseResultMap" type="com.middle.platform.manage.biz.entity.IotCloud">
+    <!--@mbg.generated-->
+    <!--@Table iot_cloud-->
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="product_id" jdbcType="BIGINT" property="productId" />
+    <result column="lang" jdbcType="TINYINT" property="lang" />
+    <result column="cloud_text" jdbcType="LONGVARCHAR" property="cloudText" />
+    <result column="create_by" jdbcType="BIGINT" property="createBy" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_by" jdbcType="BIGINT" property="updateBy" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="delete_time" jdbcType="TIMESTAMP" property="deleteTime" />
+    <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    <!--@mbg.generated-->
+    id, product_id, lang, cloud_text, create_by, create_time, update_by, update_time, 
+    delete_time, del_flag
+  </sql>
+</mapper>

+ 4 - 115
iot-module/iot-module-manage/iot-module-manage-biz/src/main/resources/mapper/IotCompanyMapper.xml

@@ -1,15 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.middle.platform.manage.biz.mapper.IotCompanyMapper">
-  <resultMap id="BaseResultMap" type="com.middle.platform.manage.biz.domain.IotCompany">
+  <resultMap id="BaseResultMap" type="com.middle.platform.manage.biz.entity.IotCompany">
     <!--@mbg.generated-->
     <!--@Table iot_company-->
-    <id column="id" jdbcType="INTEGER" property="id" />
+    <id column="id" jdbcType="BIGINT" property="id" />
     <result column="title" jdbcType="VARCHAR" property="title" />
     <result column="remark" jdbcType="VARCHAR" property="remark" />
-    <result column="create_by" jdbcType="INTEGER" property="createBy" />
+    <result column="create_by" jdbcType="BIGINT" property="createBy" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
-    <result column="update_by" jdbcType="INTEGER" property="updateBy" />
+    <result column="update_by" jdbcType="BIGINT" property="updateBy" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
     <result column="delete_time" jdbcType="TIMESTAMP" property="deleteTime" />
   </resultMap>
@@ -17,115 +17,4 @@
     <!--@mbg.generated-->
     id, title, remark, create_by, create_time, update_by, update_time, delete_time
   </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    <!--@mbg.generated-->
-    select 
-    <include refid="Base_Column_List" />
-    from iot_company
-    where id = #{id,jdbcType=INTEGER}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-    <!--@mbg.generated-->
-    delete from iot_company
-    where id = #{id,jdbcType=INTEGER}
-  </delete>
-  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.middle.platform.manage.biz.domain.IotCompany" useGeneratedKeys="true">
-    <!--@mbg.generated-->
-    insert into iot_company (title, remark, create_by, 
-      create_time, update_by, update_time, 
-      delete_time)
-    values (#{title,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{createBy,jdbcType=INTEGER}, 
-      #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, 
-      #{deleteTime,jdbcType=TIMESTAMP})
-  </insert>
-  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.middle.platform.manage.biz.domain.IotCompany" useGeneratedKeys="true">
-    <!--@mbg.generated-->
-    insert into iot_company
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="title != null">
-        title,
-      </if>
-      <if test="remark != null">
-        remark,
-      </if>
-      <if test="createBy != null">
-        create_by,
-      </if>
-      <if test="createTime != null">
-        create_time,
-      </if>
-      <if test="updateBy != null">
-        update_by,
-      </if>
-      <if test="updateTime != null">
-        update_time,
-      </if>
-      <if test="deleteTime != null">
-        delete_time,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="title != null">
-        #{title,jdbcType=VARCHAR},
-      </if>
-      <if test="remark != null">
-        #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="createBy != null">
-        #{createBy,jdbcType=INTEGER},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        #{updateBy,jdbcType=INTEGER},
-      </if>
-      <if test="updateTime != null">
-        #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="deleteTime != null">
-        #{deleteTime,jdbcType=TIMESTAMP},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.middle.platform.manage.biz.domain.IotCompany">
-    <!--@mbg.generated-->
-    update iot_company
-    <set>
-      <if test="title != null">
-        title = #{title,jdbcType=VARCHAR},
-      </if>
-      <if test="remark != null">
-        remark = #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="createBy != null">
-        create_by = #{createBy,jdbcType=INTEGER},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        update_by = #{updateBy,jdbcType=INTEGER},
-      </if>
-      <if test="updateTime != null">
-        update_time = #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="deleteTime != null">
-        delete_time = #{deleteTime,jdbcType=TIMESTAMP},
-      </if>
-    </set>
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.middle.platform.manage.biz.domain.IotCompany">
-    <!--@mbg.generated-->
-    update iot_company
-    set title = #{title,jdbcType=VARCHAR},
-      remark = #{remark,jdbcType=VARCHAR},
-      create_by = #{createBy,jdbcType=INTEGER},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      update_by = #{updateBy,jdbcType=INTEGER},
-      update_time = #{updateTime,jdbcType=TIMESTAMP},
-      delete_time = #{deleteTime,jdbcType=TIMESTAMP}
-    where id = #{id,jdbcType=INTEGER}
-  </update>
 </mapper>

+ 16 - 242
iot-module/iot-module-manage/iot-module-manage-biz/src/main/resources/mapper/IotDeviceMapper.xml

@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.middle.platform.manage.biz.mapper.IotDeviceMapper">
-  <resultMap id="BaseResultMap" type="com.middle.platform.manage.biz.domain.IotDevice">
+  <resultMap id="BaseResultMap" type="com.middle.platform.manage.biz.entity.IotDevice">
     <!--@mbg.generated-->
     <!--@Table iot_device-->
-    <id column="id" jdbcType="INTEGER" property="id" />
-    <result column="product_id" jdbcType="INTEGER" property="productId" />
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="product_id" jdbcType="BIGINT" property="productId" />
     <result column="name" jdbcType="VARCHAR" property="name" />
     <result column="sn" jdbcType="VARCHAR" property="sn" />
     <result column="guid" jdbcType="VARCHAR" property="guid" />
@@ -17,251 +17,25 @@
     <result column="status" jdbcType="TINYINT" property="status" />
     <result column="enable_flag" jdbcType="TINYINT" property="enableFlag" />
     <result column="remark" jdbcType="VARCHAR" property="remark" />
-    <result column="create_by" jdbcType="INTEGER" property="createBy" />
+    <result column="create_by" jdbcType="BIGINT" property="createBy" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
-    <result column="update_by" jdbcType="INTEGER" property="updateBy" />
+    <result column="update_by" jdbcType="BIGINT" property="updateBy" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
     <result column="delete_time" jdbcType="TIMESTAMP" property="deleteTime" />
     <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
   </resultMap>
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
-    id, product_id, `name`, sn, guid, subtitle, lon, lat, address, online_time, `status`, enable_flag, 
-    remark, create_by, create_time, update_by, update_time, delete_time, del_flag
+    id, product_id, `name`, sn, guid, subtitle, lon, lat, address, online_time, `status`,
+    enable_flag, remark, create_by, create_time, update_by, update_time, delete_time,
+    del_flag
   </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    <!--@mbg.generated-->
-    select 
-    <include refid="Base_Column_List" />
-    from iot_device
-    where id = #{id,jdbcType=INTEGER}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-    <!--@mbg.generated-->
-    delete from iot_device
-    where id = #{id,jdbcType=INTEGER}
-  </delete>
-  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.middle.platform.manage.biz.domain.IotDevice" useGeneratedKeys="true">
-    <!--@mbg.generated-->
-    insert into iot_device (product_id, `name`, sn, 
-      guid, subtitle, lon, 
-      lat, address, online_time, 
-      `status`, enable_flag, remark, 
-      create_by, create_time, update_by, 
-      update_time, delete_time, del_flag
-      )
-    values (#{productId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{sn,jdbcType=VARCHAR}, 
-      #{guid,jdbcType=VARCHAR}, #{subtitle,jdbcType=VARCHAR}, #{lon,jdbcType=DECIMAL}, 
-      #{lat,jdbcType=DECIMAL}, #{address,jdbcType=VARCHAR}, #{onlineTime,jdbcType=TIMESTAMP}, 
-      #{status,jdbcType=TINYINT}, #{enableFlag,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR}, 
-      #{createBy,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=INTEGER}, 
-      #{updateTime,jdbcType=TIMESTAMP}, #{deleteTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}
-      )
-  </insert>
-  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.middle.platform.manage.biz.domain.IotDevice" useGeneratedKeys="true">
-    <!--@mbg.generated-->
-    insert into iot_device
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="productId != null">
-        product_id,
-      </if>
-      <if test="name != null">
-        `name`,
-      </if>
-      <if test="sn != null">
-        sn,
-      </if>
-      <if test="guid != null">
-        guid,
-      </if>
-      <if test="subtitle != null">
-        subtitle,
-      </if>
-      <if test="lon != null">
-        lon,
-      </if>
-      <if test="lat != null">
-        lat,
-      </if>
-      <if test="address != null">
-        address,
-      </if>
-      <if test="onlineTime != null">
-        online_time,
-      </if>
-      <if test="status != null">
-        `status`,
-      </if>
-      <if test="enableFlag != null">
-        enable_flag,
-      </if>
-      <if test="remark != null">
-        remark,
-      </if>
-      <if test="createBy != null">
-        create_by,
-      </if>
-      <if test="createTime != null">
-        create_time,
-      </if>
-      <if test="updateBy != null">
-        update_by,
-      </if>
-      <if test="updateTime != null">
-        update_time,
-      </if>
-      <if test="deleteTime != null">
-        delete_time,
-      </if>
-      <if test="delFlag != null">
-        del_flag,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="productId != null">
-        #{productId,jdbcType=INTEGER},
-      </if>
-      <if test="name != null">
-        #{name,jdbcType=VARCHAR},
-      </if>
-      <if test="sn != null">
-        #{sn,jdbcType=VARCHAR},
-      </if>
-      <if test="guid != null">
-        #{guid,jdbcType=VARCHAR},
-      </if>
-      <if test="subtitle != null">
-        #{subtitle,jdbcType=VARCHAR},
-      </if>
-      <if test="lon != null">
-        #{lon,jdbcType=DECIMAL},
-      </if>
-      <if test="lat != null">
-        #{lat,jdbcType=DECIMAL},
-      </if>
-      <if test="address != null">
-        #{address,jdbcType=VARCHAR},
-      </if>
-      <if test="onlineTime != null">
-        #{onlineTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="status != null">
-        #{status,jdbcType=TINYINT},
-      </if>
-      <if test="enableFlag != null">
-        #{enableFlag,jdbcType=TINYINT},
-      </if>
-      <if test="remark != null">
-        #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="createBy != null">
-        #{createBy,jdbcType=INTEGER},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        #{updateBy,jdbcType=INTEGER},
-      </if>
-      <if test="updateTime != null">
-        #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="deleteTime != null">
-        #{deleteTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        #{delFlag,jdbcType=TINYINT},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.middle.platform.manage.biz.domain.IotDevice">
-    <!--@mbg.generated-->
-    update iot_device
-    <set>
-      <if test="productId != null">
-        product_id = #{productId,jdbcType=INTEGER},
-      </if>
-      <if test="name != null">
-        `name` = #{name,jdbcType=VARCHAR},
-      </if>
-      <if test="sn != null">
-        sn = #{sn,jdbcType=VARCHAR},
-      </if>
-      <if test="guid != null">
-        guid = #{guid,jdbcType=VARCHAR},
-      </if>
-      <if test="subtitle != null">
-        subtitle = #{subtitle,jdbcType=VARCHAR},
-      </if>
-      <if test="lon != null">
-        lon = #{lon,jdbcType=DECIMAL},
-      </if>
-      <if test="lat != null">
-        lat = #{lat,jdbcType=DECIMAL},
-      </if>
-      <if test="address != null">
-        address = #{address,jdbcType=VARCHAR},
-      </if>
-      <if test="onlineTime != null">
-        online_time = #{onlineTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="status != null">
-        `status` = #{status,jdbcType=TINYINT},
-      </if>
-      <if test="enableFlag != null">
-        enable_flag = #{enableFlag,jdbcType=TINYINT},
-      </if>
-      <if test="remark != null">
-        remark = #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="createBy != null">
-        create_by = #{createBy,jdbcType=INTEGER},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        update_by = #{updateBy,jdbcType=INTEGER},
-      </if>
-      <if test="updateTime != null">
-        update_time = #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="deleteTime != null">
-        delete_time = #{deleteTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        del_flag = #{delFlag,jdbcType=TINYINT},
-      </if>
-    </set>
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.middle.platform.manage.biz.domain.IotDevice">
-    <!--@mbg.generated-->
-    update iot_device
-    set product_id = #{productId,jdbcType=INTEGER},
-      `name` = #{name,jdbcType=VARCHAR},
-      sn = #{sn,jdbcType=VARCHAR},
-      guid = #{guid,jdbcType=VARCHAR},
-      subtitle = #{subtitle,jdbcType=VARCHAR},
-      lon = #{lon,jdbcType=DECIMAL},
-      lat = #{lat,jdbcType=DECIMAL},
-      address = #{address,jdbcType=VARCHAR},
-      online_time = #{onlineTime,jdbcType=TIMESTAMP},
-      `status` = #{status,jdbcType=TINYINT},
-      enable_flag = #{enableFlag,jdbcType=TINYINT},
-      remark = #{remark,jdbcType=VARCHAR},
-      create_by = #{createBy,jdbcType=INTEGER},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      update_by = #{updateBy,jdbcType=INTEGER},
-      update_time = #{updateTime,jdbcType=TIMESTAMP},
-      delete_time = #{deleteTime,jdbcType=TIMESTAMP},
-      del_flag = #{delFlag,jdbcType=TINYINT}
-    where id = #{id,jdbcType=INTEGER}
-  </update>
 
-  <select id="select" resultMap="BaseResultMap"  parameterType="com.middle.platform.manage.biz.domain.IotDevice">
-    select
-    <include refid="Base_Column_List" />
-    from iot_device
-  </select>
-</mapper>
+  <select id="queryByProduct" resultType="java.lang.Long">
+    select count(1)
+    from iot_device id
+    <where>
+      id.product_id = #{id,jdbcType=BIGINT}
+    </where>
+    </select>
+</mapper>

+ 5 - 126
iot-module/iot-module-manage/iot-module-manage-biz/src/main/resources/mapper/IotModMapper.xml

@@ -1,15 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.middle.platform.manage.biz.mapper.IotModMapper">
-  <resultMap id="BaseResultMap" type="com.middle.platform.manage.biz.domain.IotMod">
+  <resultMap id="BaseResultMap" type="com.middle.platform.manage.biz.entity.IotMod">
     <!--@mbg.generated-->
     <!--@Table iot_mod-->
-    <id column="id" jdbcType="INTEGER" property="id" />
-    <result column="product_id" jdbcType="INTEGER" property="productId" />
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="product_id" jdbcType="BIGINT" property="productId" />
     <result column="tsl_json" jdbcType="VARCHAR" property="tslJson" />
-    <result column="create_by" jdbcType="INTEGER" property="createBy" />
+    <result column="create_by" jdbcType="BIGINT" property="createBy" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
-    <result column="update_by" jdbcType="INTEGER" property="updateBy" />
+    <result column="update_by" jdbcType="BIGINT" property="updateBy" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
     <result column="delete_time" jdbcType="TIMESTAMP" property="deleteTime" />
     <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
@@ -19,125 +19,4 @@
     id, product_id, tsl_json, create_by, create_time, update_by, update_time, delete_time, 
     del_flag
   </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    <!--@mbg.generated-->
-    select 
-    <include refid="Base_Column_List" />
-    from iot_mod
-    where id = #{id,jdbcType=INTEGER}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-    <!--@mbg.generated-->
-    delete from iot_mod
-    where id = #{id,jdbcType=INTEGER}
-  </delete>
-  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.middle.platform.manage.biz.domain.IotMod" useGeneratedKeys="true">
-    <!--@mbg.generated-->
-    insert into iot_mod (product_id, tsl_json, create_by, 
-      create_time, update_by, update_time, 
-      delete_time, del_flag)
-    values (#{productId,jdbcType=INTEGER}, #{tslJson,jdbcType=VARCHAR}, #{createBy,jdbcType=INTEGER}, 
-      #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, 
-      #{deleteTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT})
-  </insert>
-  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.middle.platform.manage.biz.domain.IotMod" useGeneratedKeys="true">
-    <!--@mbg.generated-->
-    insert into iot_mod
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="productId != null">
-        product_id,
-      </if>
-      <if test="tslJson != null">
-        tsl_json,
-      </if>
-      <if test="createBy != null">
-        create_by,
-      </if>
-      <if test="createTime != null">
-        create_time,
-      </if>
-      <if test="updateBy != null">
-        update_by,
-      </if>
-      <if test="updateTime != null">
-        update_time,
-      </if>
-      <if test="deleteTime != null">
-        delete_time,
-      </if>
-      <if test="delFlag != null">
-        del_flag,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="productId != null">
-        #{productId,jdbcType=INTEGER},
-      </if>
-      <if test="tslJson != null">
-        #{tslJson,jdbcType=VARCHAR},
-      </if>
-      <if test="createBy != null">
-        #{createBy,jdbcType=INTEGER},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        #{updateBy,jdbcType=INTEGER},
-      </if>
-      <if test="updateTime != null">
-        #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="deleteTime != null">
-        #{deleteTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        #{delFlag,jdbcType=TINYINT},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.middle.platform.manage.biz.domain.IotMod">
-    <!--@mbg.generated-->
-    update iot_mod
-    <set>
-      <if test="productId != null">
-        product_id = #{productId,jdbcType=INTEGER},
-      </if>
-      <if test="tslJson != null">
-        tsl_json = #{tslJson,jdbcType=VARCHAR},
-      </if>
-      <if test="createBy != null">
-        create_by = #{createBy,jdbcType=INTEGER},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        update_by = #{updateBy,jdbcType=INTEGER},
-      </if>
-      <if test="updateTime != null">
-        update_time = #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="deleteTime != null">
-        delete_time = #{deleteTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        del_flag = #{delFlag,jdbcType=TINYINT},
-      </if>
-    </set>
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.middle.platform.manage.biz.domain.IotMod">
-    <!--@mbg.generated-->
-    update iot_mod
-    set product_id = #{productId,jdbcType=INTEGER},
-      tsl_json = #{tslJson,jdbcType=VARCHAR},
-      create_by = #{createBy,jdbcType=INTEGER},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      update_by = #{updateBy,jdbcType=INTEGER},
-      update_time = #{updateTime,jdbcType=TIMESTAMP},
-      delete_time = #{deleteTime,jdbcType=TIMESTAMP},
-      del_flag = #{delFlag,jdbcType=TINYINT}
-    where id = #{id,jdbcType=INTEGER}
-  </update>
 </mapper>

+ 17 - 223
iot-module/iot-module-manage/iot-module-manage-biz/src/main/resources/mapper/IotProductMapper.xml

@@ -1,249 +1,43 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.middle.platform.manage.biz.mapper.IotProductMapper">
-  <resultMap id="BaseResultMap" type="com.middle.platform.manage.biz.domain.IotProduct">
+  <resultMap id="BaseResultMap" type="com.middle.platform.manage.biz.entity.IotProduct">
     <!--@mbg.generated-->
     <!--@Table iot_product-->
-    <id column="id" jdbcType="INTEGER" property="id" />
+    <id column="id" jdbcType="BIGINT" property="id" />
     <result column="code" jdbcType="VARCHAR" property="code" />
     <result column="name" jdbcType="VARCHAR" property="name" />
     <result column="secret" jdbcType="VARCHAR" property="secret" />
     <result column="node_type" jdbcType="TINYINT" property="nodeType" />
     <result column="network_type" jdbcType="TINYINT" property="networkType" />
     <result column="report_protocol" jdbcType="TINYINT" property="reportProtocol" />
+    <result column="vendors" jdbcType="TINYINT" property="vendors" />
     <result column="data_format" jdbcType="TINYINT" property="dataFormat" />
     <result column="auth_type" jdbcType="TINYINT" property="authType" />
     <result column="tag" jdbcType="VARCHAR" property="tag" />
     <result column="size" jdbcType="INTEGER" property="size" />
     <result column="remark" jdbcType="VARCHAR" property="remark" />
-    <result column="create_by" jdbcType="INTEGER" property="createBy" />
+    <result column="create_by" jdbcType="BIGINT" property="createBy" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
-    <result column="update_by" jdbcType="INTEGER" property="updateBy" />
+    <result column="update_by" jdbcType="BIGINT" property="updateBy" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
     <result column="delete_time" jdbcType="TIMESTAMP" property="deleteTime" />
     <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
   </resultMap>
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
-    id, code, `name`, secret, node_type, network_type, report_protocol, data_format, 
-    auth_type, tag, `size`, remark, create_by, create_time, update_by, update_time, delete_time, 
+    id, code, `name`, secret, node_type, network_type, report_protocol, data_format, vendors,
+    auth_type, tag, `size`, remark, create_by, create_time, update_by, update_time, delete_time,
     del_flag
   </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    <!--@mbg.generated-->
-    select 
-    <include refid="Base_Column_List" />
-    from iot_product
-    where id = #{id,jdbcType=INTEGER}
+
+  <select id="pageQuery" resultType="com.middle.platform.manage.biz.domain.vo.IotProductVo">
+      select *
+      from iot_product ip
+      <where>
+          <if test="keywords != null and keywords != ''">
+              and ip.name like concat('%', #{keywords,jdbcType=VARCHAR}, '%')
+          </if>
+      </where>
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-    <!--@mbg.generated-->
-    delete from iot_product
-    where id = #{id,jdbcType=INTEGER}
-  </delete>
-  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.middle.platform.manage.biz.domain.IotProduct" useGeneratedKeys="true">
-    <!--@mbg.generated-->
-    insert into iot_product (code, `name`, secret, 
-      node_type, network_type, report_protocol, 
-      data_format, auth_type, tag, 
-      `size`, remark, create_by, 
-      create_time, update_by, update_time, 
-      delete_time, del_flag)
-    values (#{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{secret,jdbcType=VARCHAR}, 
-      #{nodeType,jdbcType=TINYINT}, #{networkType,jdbcType=TINYINT}, #{reportProtocol,jdbcType=TINYINT}, 
-      #{dataFormat,jdbcType=TINYINT}, #{authType,jdbcType=TINYINT}, #{tag,jdbcType=VARCHAR}, 
-      #{size,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, #{createBy,jdbcType=INTEGER}, 
-      #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, 
-      #{deleteTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT})
-  </insert>
-  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.middle.platform.manage.biz.domain.IotProduct" useGeneratedKeys="true">
-    <!--@mbg.generated-->
-    insert into iot_product
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="code != null">
-        code,
-      </if>
-      <if test="name != null">
-        `name`,
-      </if>
-      <if test="secret != null">
-        secret,
-      </if>
-      <if test="nodeType != null">
-        node_type,
-      </if>
-      <if test="networkType != null">
-        network_type,
-      </if>
-      <if test="reportProtocol != null">
-        report_protocol,
-      </if>
-      <if test="dataFormat != null">
-        data_format,
-      </if>
-      <if test="authType != null">
-        auth_type,
-      </if>
-      <if test="tag != null">
-        tag,
-      </if>
-      <if test="size != null">
-        `size`,
-      </if>
-      <if test="remark != null">
-        remark,
-      </if>
-      <if test="createBy != null">
-        create_by,
-      </if>
-      <if test="createTime != null">
-        create_time,
-      </if>
-      <if test="updateBy != null">
-        update_by,
-      </if>
-      <if test="updateTime != null">
-        update_time,
-      </if>
-      <if test="deleteTime != null">
-        delete_time,
-      </if>
-      <if test="delFlag != null">
-        del_flag,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="code != null">
-        #{code,jdbcType=VARCHAR},
-      </if>
-      <if test="name != null">
-        #{name,jdbcType=VARCHAR},
-      </if>
-      <if test="secret != null">
-        #{secret,jdbcType=VARCHAR},
-      </if>
-      <if test="nodeType != null">
-        #{nodeType,jdbcType=TINYINT},
-      </if>
-      <if test="networkType != null">
-        #{networkType,jdbcType=TINYINT},
-      </if>
-      <if test="reportProtocol != null">
-        #{reportProtocol,jdbcType=TINYINT},
-      </if>
-      <if test="dataFormat != null">
-        #{dataFormat,jdbcType=TINYINT},
-      </if>
-      <if test="authType != null">
-        #{authType,jdbcType=TINYINT},
-      </if>
-      <if test="tag != null">
-        #{tag,jdbcType=VARCHAR},
-      </if>
-      <if test="size != null">
-        #{size,jdbcType=INTEGER},
-      </if>
-      <if test="remark != null">
-        #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="createBy != null">
-        #{createBy,jdbcType=INTEGER},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        #{updateBy,jdbcType=INTEGER},
-      </if>
-      <if test="updateTime != null">
-        #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="deleteTime != null">
-        #{deleteTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        #{delFlag,jdbcType=TINYINT},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.middle.platform.manage.biz.domain.IotProduct">
-    <!--@mbg.generated-->
-    update iot_product
-    <set>
-      <if test="code != null">
-        code = #{code,jdbcType=VARCHAR},
-      </if>
-      <if test="name != null">
-        `name` = #{name,jdbcType=VARCHAR},
-      </if>
-      <if test="secret != null">
-        secret = #{secret,jdbcType=VARCHAR},
-      </if>
-      <if test="nodeType != null">
-        node_type = #{nodeType,jdbcType=TINYINT},
-      </if>
-      <if test="networkType != null">
-        network_type = #{networkType,jdbcType=TINYINT},
-      </if>
-      <if test="reportProtocol != null">
-        report_protocol = #{reportProtocol,jdbcType=TINYINT},
-      </if>
-      <if test="dataFormat != null">
-        data_format = #{dataFormat,jdbcType=TINYINT},
-      </if>
-      <if test="authType != null">
-        auth_type = #{authType,jdbcType=TINYINT},
-      </if>
-      <if test="tag != null">
-        tag = #{tag,jdbcType=VARCHAR},
-      </if>
-      <if test="size != null">
-        `size` = #{size,jdbcType=INTEGER},
-      </if>
-      <if test="remark != null">
-        remark = #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="createBy != null">
-        create_by = #{createBy,jdbcType=INTEGER},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        update_by = #{updateBy,jdbcType=INTEGER},
-      </if>
-      <if test="updateTime != null">
-        update_time = #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="deleteTime != null">
-        delete_time = #{deleteTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        del_flag = #{delFlag,jdbcType=TINYINT},
-      </if>
-    </set>
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.middle.platform.manage.biz.domain.IotProduct">
-    <!--@mbg.generated-->
-    update iot_product
-    set code = #{code,jdbcType=VARCHAR},
-      `name` = #{name,jdbcType=VARCHAR},
-      secret = #{secret,jdbcType=VARCHAR},
-      node_type = #{nodeType,jdbcType=TINYINT},
-      network_type = #{networkType,jdbcType=TINYINT},
-      report_protocol = #{reportProtocol,jdbcType=TINYINT},
-      data_format = #{dataFormat,jdbcType=TINYINT},
-      auth_type = #{authType,jdbcType=TINYINT},
-      tag = #{tag,jdbcType=VARCHAR},
-      `size` = #{size,jdbcType=INTEGER},
-      remark = #{remark,jdbcType=VARCHAR},
-      create_by = #{createBy,jdbcType=INTEGER},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      update_by = #{updateBy,jdbcType=INTEGER},
-      update_time = #{updateTime,jdbcType=TIMESTAMP},
-      delete_time = #{deleteTime,jdbcType=TIMESTAMP},
-      del_flag = #{delFlag,jdbcType=TINYINT}
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-</mapper>
+</mapper>

+ 6 - 135
iot-module/iot-module-manage/iot-module-manage-biz/src/main/resources/mapper/IotProjectDeviceMapper.xml

@@ -1,15 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.middle.platform.manage.biz.mapper.IotProjectDeviceMapper">
-  <resultMap id="BaseResultMap" type="com.middle.platform.manage.biz.domain.IotProjectDevice">
+  <resultMap id="BaseResultMap" type="com.middle.platform.manage.biz.entity.IotProjectDevice">
     <!--@mbg.generated-->
     <!--@Table iot_project_device-->
-    <id column="id" jdbcType="INTEGER" property="id" />
-    <result column="project_id" jdbcType="INTEGER" property="projectId" />
-    <result column="device_id" jdbcType="INTEGER" property="deviceId" />
-    <result column="create_by" jdbcType="INTEGER" property="createBy" />
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="project_id" jdbcType="BIGINT" property="projectId" />
+    <result column="device_id" jdbcType="BIGINT" property="deviceId" />
+    <result column="create_by" jdbcType="BIGINT" property="createBy" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
-    <result column="update_by" jdbcType="INTEGER" property="updateBy" />
+    <result column="update_by" jdbcType="BIGINT" property="updateBy" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="delete_time" jdbcType="TIMESTAMP" property="deleteTime" />
     <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
@@ -19,133 +19,4 @@
     id, project_id, device_id, create_by, update_time, update_by, create_time, delete_time, 
     del_flag
   </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    <!--@mbg.generated-->
-    select 
-    <include refid="Base_Column_List" />
-    from iot_project_device
-    where id = #{id,jdbcType=INTEGER}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-    <!--@mbg.generated-->
-    delete from iot_project_device
-    where id = #{id,jdbcType=INTEGER}
-  </delete>
-  <insert id="insert" parameterType="com.middle.platform.manage.biz.domain.IotProjectDevice">
-    <!--@mbg.generated-->
-    insert into iot_project_device (id, project_id, device_id, 
-      create_by, update_time, update_by, 
-      create_time, delete_time, del_flag
-      )
-    values (#{id,jdbcType=INTEGER}, #{projectId,jdbcType=INTEGER}, #{deviceId,jdbcType=INTEGER}, 
-      #{createBy,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=INTEGER}, 
-      #{createTime,jdbcType=TIMESTAMP}, #{deleteTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}
-      )
-  </insert>
-  <insert id="insertSelective" parameterType="com.middle.platform.manage.biz.domain.IotProjectDevice">
-    <!--@mbg.generated-->
-    insert into iot_project_device
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
-      </if>
-      <if test="projectId != null">
-        project_id,
-      </if>
-      <if test="deviceId != null">
-        device_id,
-      </if>
-      <if test="createBy != null">
-        create_by,
-      </if>
-      <if test="updateTime != null">
-        update_time,
-      </if>
-      <if test="updateBy != null">
-        update_by,
-      </if>
-      <if test="createTime != null">
-        create_time,
-      </if>
-      <if test="deleteTime != null">
-        delete_time,
-      </if>
-      <if test="delFlag != null">
-        del_flag,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=INTEGER},
-      </if>
-      <if test="projectId != null">
-        #{projectId,jdbcType=INTEGER},
-      </if>
-      <if test="deviceId != null">
-        #{deviceId,jdbcType=INTEGER},
-      </if>
-      <if test="createBy != null">
-        #{createBy,jdbcType=INTEGER},
-      </if>
-      <if test="updateTime != null">
-        #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        #{updateBy,jdbcType=INTEGER},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="deleteTime != null">
-        #{deleteTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        #{delFlag,jdbcType=TINYINT},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.middle.platform.manage.biz.domain.IotProjectDevice">
-    <!--@mbg.generated-->
-    update iot_project_device
-    <set>
-      <if test="projectId != null">
-        project_id = #{projectId,jdbcType=INTEGER},
-      </if>
-      <if test="deviceId != null">
-        device_id = #{deviceId,jdbcType=INTEGER},
-      </if>
-      <if test="createBy != null">
-        create_by = #{createBy,jdbcType=INTEGER},
-      </if>
-      <if test="updateTime != null">
-        update_time = #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        update_by = #{updateBy,jdbcType=INTEGER},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="deleteTime != null">
-        delete_time = #{deleteTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        del_flag = #{delFlag,jdbcType=TINYINT},
-      </if>
-    </set>
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.middle.platform.manage.biz.domain.IotProjectDevice">
-    <!--@mbg.generated-->
-    update iot_project_device
-    set project_id = #{projectId,jdbcType=INTEGER},
-      device_id = #{deviceId,jdbcType=INTEGER},
-      create_by = #{createBy,jdbcType=INTEGER},
-      update_time = #{updateTime,jdbcType=TIMESTAMP},
-      update_by = #{updateBy,jdbcType=INTEGER},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      delete_time = #{deleteTime,jdbcType=TIMESTAMP},
-      del_flag = #{delFlag,jdbcType=TINYINT}
-    where id = #{id,jdbcType=INTEGER}
-  </update>
 </mapper>

+ 7 - 149
iot-module/iot-module-manage/iot-module-manage-biz/src/main/resources/mapper/IotProjectMapper.xml

@@ -1,167 +1,25 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.middle.platform.manage.biz.mapper.IotProjectMapper">
-  <resultMap id="BaseResultMap" type="com.middle.platform.manage.biz.domain.IotProject">
+  <resultMap id="BaseResultMap" type="com.middle.platform.manage.biz.entity.IotProject">
     <!--@mbg.generated-->
     <!--@Table iot_project-->
-    <id column="id" jdbcType="INTEGER" property="id" />
-    <result column="company_id" jdbcType="INTEGER" property="companyId" />
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="company_id" jdbcType="BIGINT" property="companyId" />
     <result column="code" jdbcType="VARCHAR" property="code" />
     <result column="title" jdbcType="VARCHAR" property="title" />
     <result column="remark" jdbcType="VARCHAR" property="remark" />
     <result column="status" jdbcType="TINYINT" property="status" />
-    <result column="create_by" jdbcType="INTEGER" property="createBy" />
+    <result column="create_by" jdbcType="BIGINT" property="createBy" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
-    <result column="update_by" jdbcType="INTEGER" property="updateBy" />
+    <result column="update_by" jdbcType="BIGINT" property="updateBy" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
     <result column="delete_time" jdbcType="TIMESTAMP" property="deleteTime" />
+    <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
   </resultMap>
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
     id, company_id, code, title, remark, `status`, create_by, create_time, update_by, 
-    update_time, delete_time
+    update_time, delete_time, del_flag
   </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    <!--@mbg.generated-->
-    select 
-    <include refid="Base_Column_List" />
-    from iot_project
-    where id = #{id,jdbcType=INTEGER}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-    <!--@mbg.generated-->
-    delete from iot_project
-    where id = #{id,jdbcType=INTEGER}
-  </delete>
-  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.middle.platform.manage.biz.domain.IotProject" useGeneratedKeys="true">
-    <!--@mbg.generated-->
-    insert into iot_project (company_id, code, title, 
-      remark, `status`, create_by, 
-      create_time, update_by, update_time, 
-      delete_time)
-    values (#{companyId,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, 
-      #{remark,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, #{createBy,jdbcType=INTEGER}, 
-      #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, 
-      #{deleteTime,jdbcType=TIMESTAMP})
-  </insert>
-  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.middle.platform.manage.biz.domain.IotProject" useGeneratedKeys="true">
-    <!--@mbg.generated-->
-    insert into iot_project
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="companyId != null">
-        company_id,
-      </if>
-      <if test="code != null">
-        code,
-      </if>
-      <if test="title != null">
-        title,
-      </if>
-      <if test="remark != null">
-        remark,
-      </if>
-      <if test="status != null">
-        `status`,
-      </if>
-      <if test="createBy != null">
-        create_by,
-      </if>
-      <if test="createTime != null">
-        create_time,
-      </if>
-      <if test="updateBy != null">
-        update_by,
-      </if>
-      <if test="updateTime != null">
-        update_time,
-      </if>
-      <if test="deleteTime != null">
-        delete_time,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="companyId != null">
-        #{companyId,jdbcType=INTEGER},
-      </if>
-      <if test="code != null">
-        #{code,jdbcType=VARCHAR},
-      </if>
-      <if test="title != null">
-        #{title,jdbcType=VARCHAR},
-      </if>
-      <if test="remark != null">
-        #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="status != null">
-        #{status,jdbcType=TINYINT},
-      </if>
-      <if test="createBy != null">
-        #{createBy,jdbcType=INTEGER},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        #{updateBy,jdbcType=INTEGER},
-      </if>
-      <if test="updateTime != null">
-        #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="deleteTime != null">
-        #{deleteTime,jdbcType=TIMESTAMP},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.middle.platform.manage.biz.domain.IotProject">
-    <!--@mbg.generated-->
-    update iot_project
-    <set>
-      <if test="companyId != null">
-        company_id = #{companyId,jdbcType=INTEGER},
-      </if>
-      <if test="code != null">
-        code = #{code,jdbcType=VARCHAR},
-      </if>
-      <if test="title != null">
-        title = #{title,jdbcType=VARCHAR},
-      </if>
-      <if test="remark != null">
-        remark = #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="status != null">
-        `status` = #{status,jdbcType=TINYINT},
-      </if>
-      <if test="createBy != null">
-        create_by = #{createBy,jdbcType=INTEGER},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        update_by = #{updateBy,jdbcType=INTEGER},
-      </if>
-      <if test="updateTime != null">
-        update_time = #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="deleteTime != null">
-        delete_time = #{deleteTime,jdbcType=TIMESTAMP},
-      </if>
-    </set>
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.middle.platform.manage.biz.domain.IotProject">
-    <!--@mbg.generated-->
-    update iot_project
-    set company_id = #{companyId,jdbcType=INTEGER},
-      code = #{code,jdbcType=VARCHAR},
-      title = #{title,jdbcType=VARCHAR},
-      remark = #{remark,jdbcType=VARCHAR},
-      `status` = #{status,jdbcType=TINYINT},
-      create_by = #{createBy,jdbcType=INTEGER},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      update_by = #{updateBy,jdbcType=INTEGER},
-      update_time = #{updateTime,jdbcType=TIMESTAMP},
-      delete_time = #{deleteTime,jdbcType=TIMESTAMP}
-    where id = #{id,jdbcType=INTEGER}
-  </update>
 </mapper>

+ 5 - 158
iot-module/iot-module-manage/iot-module-manage-biz/src/main/resources/mapper/IotUrlMapper.xml

@@ -1,18 +1,18 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.middle.platform.manage.biz.mapper.IotUrlMapper">
-  <resultMap id="BaseResultMap" type="com.middle.platform.manage.biz.domain.IotUrl">
+  <resultMap id="BaseResultMap" type="com.middle.platform.manage.biz.entity.IotUrl">
     <!--@mbg.generated-->
     <!--@Table iot_url-->
-    <id column="id" jdbcType="INTEGER" property="id" />
-    <result column="product_id" jdbcType="INTEGER" property="productId" />
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="product_id" jdbcType="BIGINT" property="productId" />
     <result column="url" jdbcType="VARCHAR" property="url" />
     <result column="type" jdbcType="TINYINT" property="type" />
     <result column="permission" jdbcType="TINYINT" property="permission" />
     <result column="remark" jdbcType="VARCHAR" property="remark" />
-    <result column="create_by" jdbcType="INTEGER" property="createBy" />
+    <result column="create_by" jdbcType="BIGINT" property="createBy" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
-    <result column="update_by" jdbcType="INTEGER" property="updateBy" />
+    <result column="update_by" jdbcType="BIGINT" property="updateBy" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
     <result column="delete_time" jdbcType="TIMESTAMP" property="deleteTime" />
     <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
@@ -22,157 +22,4 @@
     id, product_id, url, `type`, permission, remark, create_by, create_time, update_by, 
     update_time, delete_time, del_flag
   </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    <!--@mbg.generated-->
-    select 
-    <include refid="Base_Column_List" />
-    from iot_url
-    where id = #{id,jdbcType=INTEGER}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-    <!--@mbg.generated-->
-    delete from iot_url
-    where id = #{id,jdbcType=INTEGER}
-  </delete>
-  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.middle.platform.manage.biz.domain.IotUrl" useGeneratedKeys="true">
-    <!--@mbg.generated-->
-    insert into iot_url (product_id, url, `type`, 
-      permission, remark, create_by, 
-      create_time, update_by, update_time, 
-      delete_time, del_flag)
-    values (#{productId,jdbcType=INTEGER}, #{url,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT}, 
-      #{permission,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR}, #{createBy,jdbcType=INTEGER}, 
-      #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, 
-      #{deleteTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT})
-  </insert>
-  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.middle.platform.manage.biz.domain.IotUrl" useGeneratedKeys="true">
-    <!--@mbg.generated-->
-    insert into iot_url
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="productId != null">
-        product_id,
-      </if>
-      <if test="url != null">
-        url,
-      </if>
-      <if test="type != null">
-        `type`,
-      </if>
-      <if test="permission != null">
-        permission,
-      </if>
-      <if test="remark != null">
-        remark,
-      </if>
-      <if test="createBy != null">
-        create_by,
-      </if>
-      <if test="createTime != null">
-        create_time,
-      </if>
-      <if test="updateBy != null">
-        update_by,
-      </if>
-      <if test="updateTime != null">
-        update_time,
-      </if>
-      <if test="deleteTime != null">
-        delete_time,
-      </if>
-      <if test="delFlag != null">
-        del_flag,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="productId != null">
-        #{productId,jdbcType=INTEGER},
-      </if>
-      <if test="url != null">
-        #{url,jdbcType=VARCHAR},
-      </if>
-      <if test="type != null">
-        #{type,jdbcType=TINYINT},
-      </if>
-      <if test="permission != null">
-        #{permission,jdbcType=TINYINT},
-      </if>
-      <if test="remark != null">
-        #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="createBy != null">
-        #{createBy,jdbcType=INTEGER},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        #{updateBy,jdbcType=INTEGER},
-      </if>
-      <if test="updateTime != null">
-        #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="deleteTime != null">
-        #{deleteTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        #{delFlag,jdbcType=TINYINT},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.middle.platform.manage.biz.domain.IotUrl">
-    <!--@mbg.generated-->
-    update iot_url
-    <set>
-      <if test="productId != null">
-        product_id = #{productId,jdbcType=INTEGER},
-      </if>
-      <if test="url != null">
-        url = #{url,jdbcType=VARCHAR},
-      </if>
-      <if test="type != null">
-        `type` = #{type,jdbcType=TINYINT},
-      </if>
-      <if test="permission != null">
-        permission = #{permission,jdbcType=TINYINT},
-      </if>
-      <if test="remark != null">
-        remark = #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="createBy != null">
-        create_by = #{createBy,jdbcType=INTEGER},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        update_by = #{updateBy,jdbcType=INTEGER},
-      </if>
-      <if test="updateTime != null">
-        update_time = #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="deleteTime != null">
-        delete_time = #{deleteTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        del_flag = #{delFlag,jdbcType=TINYINT},
-      </if>
-    </set>
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.middle.platform.manage.biz.domain.IotUrl">
-    <!--@mbg.generated-->
-    update iot_url
-    set product_id = #{productId,jdbcType=INTEGER},
-      url = #{url,jdbcType=VARCHAR},
-      `type` = #{type,jdbcType=TINYINT},
-      permission = #{permission,jdbcType=TINYINT},
-      remark = #{remark,jdbcType=VARCHAR},
-      create_by = #{createBy,jdbcType=INTEGER},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      update_by = #{updateBy,jdbcType=INTEGER},
-      update_time = #{updateTime,jdbcType=TIMESTAMP},
-      delete_time = #{deleteTime,jdbcType=TIMESTAMP},
-      del_flag = #{delFlag,jdbcType=TINYINT}
-    where id = #{id,jdbcType=INTEGER}
-  </update>
 </mapper>

+ 2 - 1
iot-module/iot-module-system/iot-module-system-api/src/main/java/com/middle/platform/system/api/feign/DictApi.java

@@ -1,5 +1,6 @@
 package com.middle.platform.system.api.feign;
 
+import com.middle.platform.common.constant.RpcConstants;
 import com.middle.platform.common.utils.Result;
 import com.middle.platform.system.api.enums.ApiConstants;
 import com.middle.platform.system.api.pojo.DictDto;
@@ -13,7 +14,7 @@ import org.springframework.web.bind.annotation.RequestParam;
  */
 @FeignClient(name = ApiConstants.NAME)
 public interface DictApi {
-    String PREFIX = "/dict-data";
+    String PREFIX = RpcConstants.RPC_API_PREFIX + "/dict-data";
 
     @GetMapping(PREFIX + "/get")
     Result<DictDto> getDictData(@RequestParam("dictType") String dictType,

+ 21 - 0
iot-module/iot-module-system/iot-module-system-api/src/main/java/com/middle/platform/system/api/feign/UserApi.java

@@ -1,8 +1,29 @@
 package com.middle.platform.system.api.feign;
 
+import com.middle.platform.common.constant.RpcConstants;
+import com.middle.platform.system.api.enums.ApiConstants;
+import com.middle.platform.system.api.pojo.SysUserFlag;
+import com.middle.platform.system.api.pojo.UserDto;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
+
 /**
  * @author xucaiqin
  * @date 2023-12-17 13:51:33
  */
+@FeignClient(name = ApiConstants.NAME)
 public interface UserApi {
+    String prefix = RpcConstants.RPC_API_PREFIX + "/user";
+
+    @GetMapping(prefix + "/get")
+    UserDto queryAccount(@RequestParam("username") String username);
+
+    @GetMapping(prefix + "/resetPassword")
+    void resetPassword(@RequestParam("id") Long id);
+
+    @PostMapping(prefix + "/changeUse")
+    void changeUse(@RequestBody SysUserFlag sysUserFlag);
 }

+ 15 - 0
iot-module/iot-module-system/iot-module-system-api/src/main/java/com/middle/platform/system/api/pojo/SysUserFlag.java

@@ -0,0 +1,15 @@
+package com.middle.platform.system.api.pojo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author xucaiqin
+ * @date 2023-12-19 10:14:01
+ */
+@Getter
+@Setter
+public class SysUserFlag {
+    private Long id;
+    private Integer status;
+}

+ 0 - 8
iot-module/iot-module-system/iot-module-system-api/src/main/java/com/middle/platform/system/api/pojo/User.java

@@ -1,8 +0,0 @@
-package com.middle.platform.system.api.pojo;
-
-/**
- * @author xucaiqin
- * @date 2023-12-17 10:50:57
- */
-public class User {
-}

+ 16 - 0
iot-module/iot-module-system/iot-module-system-api/src/main/java/com/middle/platform/system/api/pojo/UserDto.java

@@ -0,0 +1,16 @@
+package com.middle.platform.system.api.pojo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author xucaiqin
+ * @date 2023-12-17 10:50:57
+ */
+@Getter
+@Setter
+public class UserDto {
+    private Long id;
+    private String username;
+    private String password;
+}

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません