From e5c5137e91c04fff001d439d64ed5a253e3fc8da Mon Sep 17 00:00:00 2001
From: jiazx0107@163.com <jiazx0107@163.com>
Date: 星期一, 23 十月 2023 20:18:05 +0800
Subject: [PATCH] 初期提交四川相关配置
---
src/main/java/com/fzzy/api/utils/ShRSAUtils.java | 2
src/main/java/com/fzzy/mqtt/MqttCondition.java | 25 +
src/main/java/com/fzzy/sys/RolePR.java | 2
src/main/resources/application-gateway.yml | 57 ++
src/main/java/com/fzzy/gateway/sc2023/api/ApiInitService.java | 15
src/main/java/com/fzzy/mqtt/MqttProperties.java | 78 +++
src/main/resources/application-pro.yml | 2
pom.xml | 666 +++++++++++++++-------------
src/main/java/com/fzzy/gateway/package-info.java | 4
src/main/java/com/fzzy/mqtt/MqttAcceptCallback.java | 90 +++
/dev/null | 1
src/main/java/com/fzzy/conf/WebsocketConfig.java | 17
src/main/java/com/fzzy/api/utils/AESUtils.java | 1
src/main/java/com/fzzy/gateway/sc2023/ScConstant.java | 15
src/main/java/com/fzzy/sys/UserPR.java | 19
src/main/java/com/fzzy/gateway/entity/GatewayConf.java | 60 ++
src/main/java/com/fzzy/gateway/sc2023/package-info.java | 5
src/main/java/com/fzzy/api/utils/ContextUtil.java | 3
src/main/resources/application-dev.yml | 78 ++-
src/main/java/com/fzzy/gateway/sc2023/websocket/WebSocketMqtt.java | 78 +++
src/main/java/com/fzzy/gateway/GatewayRunner.java | 30 +
src/main/java/com/fzzy/mqtt/MqttAcceptClient.java | 104 ++++
src/main/resources/application.yml | 2
23 files changed, 980 insertions(+), 374 deletions(-)
diff --git a/pom.xml b/pom.xml
index f970b1e..f060457 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,358 +1,388 @@
<?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">
+ 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>
- <groupId>com.fzzy</groupId>
- <artifactId>igds-api</artifactId>
- <version>0.0.2-SNAPSHOT</version>
- <packaging>jar</packaging>
- <name>igds-api</name>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.fzzy</groupId>
+ <artifactId>igds-api</artifactId>
+ <version>0.0.2-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <name>igds-api</name>
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <spring.boot.version>2.1.2.RELEASE</spring.boot.version>
- <spring.version>5.1.1.RELEASE</spring.version>
- <dorado.version>7.6.0-SNAPSHOT</dorado.version>
- <druid.version>1.2.8</druid.version>
- <mysql.version>5.1.45</mysql.version>
- <fastjson.version>2.0.10</fastjson.version>
- <lombok.version>1.18.22</lombok.version>
- <spring.security>3.1.4.RELEASE</spring.security>
- </properties>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <spring.boot.version>2.1.2.RELEASE</spring.boot.version>
+ <spring.version>5.1.1.RELEASE</spring.version>
+ <dorado.version>7.6.0-SNAPSHOT</dorado.version>
+ <druid.version>1.2.8</druid.version>
+ <mysql.version>5.1.45</mysql.version>
+ <fastjson.version>2.0.10</fastjson.version>
+ <lombok.version>1.18.22</lombok.version>
+ <spring.security>3.1.4.RELEASE</spring.security>
+ </properties>
- <dependencies>
+ <dependencies>
- <!-- DORADO7涓棿浠� -->
- <dependency>
- <groupId>com.bstek.dorado</groupId>
- <artifactId>dorado-core</artifactId>
- <version>${dorado.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <artifactId>javassist</artifactId>
- <groupId>javassist</groupId>
- </exclusion>
- </exclusions>
- </dependency>
+ <!-- DORADO7涓棿浠� -->
+ <dependency>
+ <groupId>com.bstek.dorado</groupId>
+ <artifactId>dorado-core</artifactId>
+ <version>${dorado.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
+ <exclusion>
+ <artifactId>javassist</artifactId>
+ <groupId>javassist</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>dom4j</artifactId>
+ <groupId>dom4j</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
- <dependency>
- <groupId>com.bstek.dorado</groupId>
- <artifactId>dorado-uploader</artifactId>
- <version>1.0.20</version>
- <exclusions>
- <exclusion>
- <artifactId>slf4j-jcl</artifactId>
- <groupId>org.slf4j</groupId>
- </exclusion>
- <exclusion>
- <artifactId>slf4j-log4j12</artifactId>
- <groupId>org.slf4j</groupId>
- </exclusion>
- <exclusion>
- <artifactId>log4j</artifactId>
- <groupId>log4j</groupId>
- </exclusion>
- <exclusion>
- <artifactId>slf4j-jdk14</artifactId>
- <groupId>org.slf4j</groupId>
- </exclusion>
- </exclusions>
- </dependency>
+ <dependency>
+ <groupId>com.bstek.dorado</groupId>
+ <artifactId>dorado-uploader</artifactId>
+ <version>1.0.20</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>slf4j-jcl</artifactId>
+ <groupId>org.slf4j</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>slf4j-log4j12</artifactId>
+ <groupId>org.slf4j</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>log4j</artifactId>
+ <groupId>log4j</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>slf4j-jdk14</artifactId>
+ <groupId>org.slf4j</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- <version>2.9.8</version>
- <!-- <scope>runtime</scope>-->
- </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-core</artifactId>
+ <version>2.9.8</version>
+ <!-- <scope>runtime</scope> -->
+ </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>2.9.8</version>
- <!-- <scope>runtime</scope>-->
- </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>2.9.8</version>
+ <!-- <scope>runtime</scope> -->
+ </dependency>
- <!-- springBoot -->
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-data-jpa</artifactId>
- <version>${spring.boot.version}</version>
- </dependency>
+ <!-- springBoot -->
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-data-jpa</artifactId>
+ <version>${spring.boot.version}</version>
+ </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-web</artifactId>
- <version>${spring.boot.version}</version>
- <exclusions>
- <exclusion>
- <artifactId>jackson-databind</artifactId>
- <groupId>com.fasterxml.jackson.core</groupId>
- </exclusion>
- </exclusions>
- </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ <version>${spring.boot.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>jackson-databind</artifactId>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
- <!-- REDIS -->
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-data-redis</artifactId>
- <version>${spring.boot.version}</version>
- </dependency>
+ <!-- REDIS -->
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-data-redis</artifactId>
+ <version>${spring.boot.version}</version>
+ </dependency>
- <!-- thymeleaf -->
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-thymeleaf</artifactId>
- <version>${spring.boot.version}</version>
- </dependency>
-
- <dependency>
- <groupId>net.sourceforge.nekohtml</groupId>
- <artifactId>nekohtml</artifactId>
- <version>1.9.22</version>
- </dependency>
-
- <dependency>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- <version>1.4.01</version>
- </dependency>
-
- <!-- Security -->
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-core</artifactId>
- <version>${spring.security}</version>
- </dependency>
+ <!-- websocket -->
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-websocket</artifactId>
+ <version>${spring.boot.version}</version>
+ </dependency>
- <!-- druid -->
- <!-- <dependency> -->
- <!-- <groupId>com.alibaba</groupId> -->
- <!-- <artifactId>druid-spring-boot-starter</artifactId> -->
- <!-- <version>${druid.version}</version> -->
- <!-- </dependency> -->
+ <!-- mqtt -->
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-integration</artifactId>
+ <version>${spring.boot.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.integration</groupId>
+ <artifactId>spring-integration-stream</artifactId>
+ <version>5.2.0.RELEASE</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.integration</groupId>
+ <artifactId>spring-integration-mqtt</artifactId>
+ <version>5.2.0.RELEASE</version>
+ </dependency>
+
+ <!-- thymeleaf -->
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-thymeleaf</artifactId>
+ <version>${spring.boot.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sourceforge.nekohtml</groupId>
+ <artifactId>nekohtml</artifactId>
+ <version>1.9.22</version>
+ </dependency>
+
+ <dependency>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ <version>1.4.01</version>
+ </dependency>
+
+ <!-- Security <dependency> <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-core</artifactId> <version>${spring.security}</version>
+ </dependency> -->
- <!-- mysql杩炴帴 -->
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>${mysql.version}</version>
- </dependency>
+ <!-- druid -->
+ <!-- <dependency> -->
+ <!-- <groupId>com.alibaba</groupId> -->
+ <!-- <artifactId>druid-spring-boot-starter</artifactId> -->
+ <!-- <version>${druid.version}</version> -->
+ <!-- </dependency> -->
- <!-- JSON-->
- <dependency>
- <groupId>com.alibaba</groupId>
- <artifactId>fastjson</artifactId>
- <version>${fastjson.version}</version>
- </dependency>
+ <!-- mysql杩炴帴 -->
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>${mysql.version}</version>
+ </dependency>
- <!-- lombok -->
- <dependency>
- <groupId>org.projectlombok</groupId>
- <artifactId>lombok</artifactId>
- <version>${lombok.version}</version>
- </dependency>
-
- <!-- 鐧婚檰楠岃瘉鐮� -->
- <dependency>
- <groupId>com.github.whvcse</groupId>
- <artifactId>easy-captcha</artifactId>
- <version>1.6.2</version>
- </dependency>
-
- <!-- 鐨偆鍖� -->
- <dependency>
- <groupId>dorado.skins</groupId>
- <artifactId>sky</artifactId>
- <version>2.0.0</version>
- <scope>system</scope>
- <systemPath>${project.basedir}/src/main/resources/lib/dorado-skin-sky-2.0.2.jar</systemPath>
- </dependency>
-
- <!-- 闆嗘垚httpclient -->
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- <version>4.4.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpcore</artifactId>
- <version>4.4.1</version>
- </dependency>
-
- <!-- 鍥藉瘑 -->
- <dependency>
- <groupId>org.bouncycastle</groupId>
- <artifactId>bcprov-jdk15on</artifactId>
- <version>1.70</version>
- </dependency>
-
- <dependency>
- <groupId>org.bouncycastle</groupId>
- <artifactId>bcprov-ext-jdk15on</artifactId>
- <version>1.70</version>
- </dependency>
-
- <dependency>
- <groupId>cn.lxem</groupId>
- <artifactId>scde</artifactId>
- <version>1.0</version>
- <scope>system</scope>
- <systemPath>${project.basedir}/src/main/resources/lib/RulesModel-1.0.jar</systemPath>
- </dependency>
- <dependency>
- <groupId>cn.lxem</groupId>
- <artifactId>scde</artifactId>
- <version>1.0</version>
- <scope>system</scope>
- <systemPath>${project.basedir}/src/main/resources/lib/SM2Crypto-1.0.jar</systemPath>
- </dependency>
+ <!-- JSON -->
+ <dependency>
+ <groupId>com.alibaba</groupId>
+ <artifactId>fastjson</artifactId>
+ <version>${fastjson.version}</version>
+ </dependency>
- <!--骞夸笢鐪佸钩鍙板鎺� -->
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-core</artifactId>
- <version>3.2.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-bindings-soap</artifactId>
- <version>3.2.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-bindings-xml</artifactId>
- <version>3.2.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-frontend-jaxws</artifactId>
- <version>3.2.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-transports-http</artifactId>
- <version>3.2.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-ws-policy</artifactId>
- <version>3.2.2</version>
- </dependency>
+ <!-- lombok -->
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ <version>${lombok.version}</version>
+ </dependency>
- <!-- <dependency>-->
- <!-- <groupId>org.apache.cxf</groupId>-->
- <!-- <artifactId>cxf-spring-boot-autoconfigure</artifactId>-->
- <!-- <version>3.2.2</version>-->
- <!-- </dependency>-->
- <!-- <dependency>-->
- <!-- <groupId>org.apache.cxf</groupId>-->
- <!-- <artifactId>cxf-spring-boot-starter-jaxws</artifactId>-->
- <!-- <version>3.2.2</version>-->
- <!-- </dependency>-->
+ <!-- 鐧婚檰楠岃瘉鐮� -->
+ <dependency>
+ <groupId>com.github.whvcse</groupId>
+ <artifactId>easy-captcha</artifactId>
+ <version>1.6.2</version>
+ </dependency>
+
+ <!-- 鐨偆鍖� -->
+ <dependency>
+ <groupId>dorado.skins</groupId>
+ <artifactId>sky</artifactId>
+ <version>2.0.0</version>
+ <scope>system</scope>
+ <systemPath>${project.basedir}/src/main/resources/lib/dorado-skin-sky-2.0.2.jar</systemPath>
+ </dependency>
+
+ <!-- 闆嗘垚httpclient -->
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>4.4.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpcore</artifactId>
+ <version>4.4.1</version>
+ </dependency>
+
+ <!-- 鍥藉瘑 -->
+ <dependency>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcprov-jdk15on</artifactId>
+ <version>1.70</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcprov-ext-jdk15on</artifactId>
+ <version>1.70</version>
+ </dependency>
+
+ <dependency>
+ <groupId>cn.lxem</groupId>
+ <artifactId>scde</artifactId>
+ <version>1.0</version>
+ <scope>system</scope>
+ <systemPath>${project.basedir}/src/main/resources/lib/RulesModel-1.0.jar</systemPath>
+ </dependency>
+ <dependency>
+ <groupId>cn.lxem</groupId>
+ <artifactId>scde</artifactId>
+ <version>1.0</version>
+ <scope>system</scope>
+ <systemPath>${project.basedir}/src/main/resources/lib/SM2Crypto-1.0.jar</systemPath>
+ </dependency>
- </dependencies>
+ <!--骞夸笢鐪佸钩鍙板鎺� -->
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-core</artifactId>
+ <version>3.2.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-bindings-soap</artifactId>
+ <version>3.2.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-bindings-xml</artifactId>
+ <version>3.2.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxws</artifactId>
+ <version>3.2.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-transports-http</artifactId>
+ <version>3.2.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-ws-policy</artifactId>
+ <version>3.2.2</version>
+ </dependency>
+
+ <!-- <dependency> -->
+ <!-- <groupId>org.apache.cxf</groupId> -->
+ <!-- <artifactId>cxf-spring-boot-autoconfigure</artifactId> -->
+ <!-- <version>3.2.2</version> -->
+ <!-- </dependency> -->
+ <!-- <dependency> -->
+ <!-- <groupId>org.apache.cxf</groupId> -->
+ <!-- <artifactId>cxf-spring-boot-starter-jaxws</artifactId> -->
+ <!-- <version>3.2.2</version> -->
+ <!-- </dependency> -->
- <build>
- <plugins>
- <!-- 璁剧疆缂栬瘧鐗堟湰 -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- <encoding>UTF-8</encoding>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>repackage</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
-
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- <resource>
- <directory>src/main/java</directory>
- </resource>
- <resource>
- <directory>src/main/resources/lib</directory>
- <targetPath>BOOT-INF/lib/</targetPath>
- <includes>
- <include>**/*.jar</include>
- </includes>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- <targetPath>BOOT-INF/classes/</targetPath>
- </resource>
- </resources>
+ </dependencies>
- <finalName>igds-api</finalName>
+ <build>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
+ <configuration>
+ <source>1.8</source>
+ <target>1.8</target>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+<!-- <plugin>-->
+<!-- <groupId>org.springframework.boot</groupId>-->
+<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
+<!-- <executions>-->
+<!-- <execution>-->
+<!-- <goals>-->
+<!-- <goal>repackage</goal>-->
+<!-- </goals>-->
+<!-- </execution>-->
+<!-- </executions>-->
+<!-- </plugin>-->
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-framework-bom</artifactId>
- <version>${spring.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
+ </plugins>
+
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory>src/main/java</directory>
+ </resource>
+ <resource>
+ <directory>src/main/resources/lib</directory>
+ <targetPath>BOOT-INF/lib/</targetPath>
+ <includes>
+ <include>**/*.jar</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <targetPath>BOOT-INF/classes/</targetPath>
+ </resource>
+ </resources>
- <repositories>
- <repository>
- <id>sonatype</id>
- <url>https://oss.sonatype.org/content/groups/public/</url>
- </repository>
- <repository>
- <id>bsdn-maven-repository</id>
- <url>http://nexus.bsdn.org/content/groups/public/</url>
- </repository>
- </repositories>
+ <finalName>igds-api</finalName>
- <pluginRepositories>
- <pluginRepository>
- <id>spring-snapshots</id>
- <url>http://repo.spring.io/snapshot</url>
- </pluginRepository>
- <pluginRepository>
- <id>spring-milestones</id>
- <url>http://repo.spring.io/milestone</url>
- </pluginRepository>
- </pluginRepositories>
+ </build>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-framework-bom</artifactId>
+ <version>${spring.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+
+ <repositories>
+ <repository>
+ <id>sonatype</id>
+ <url>https://oss.sonatype.org/content/groups/public/</url>
+ </repository>
+ <repository>
+ <id>bsdn-maven-repository</id>
+ <url>http://nexus.bsdn.org/content/groups/public/</url>
+ </repository>
+ </repositories>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>spring-snapshots</id>
+ <url>http://repo.spring.io/snapshot</url>
+ </pluginRepository>
+ <pluginRepository>
+ <id>spring-milestones</id>
+ <url>http://repo.spring.io/milestone</url>
+ </pluginRepository>
+ </pluginRepositories>
</project>
diff --git a/src/main/java/com/fzzy/api/utils/AESUtils.java b/src/main/java/com/fzzy/api/utils/AESUtils.java
index ef9d6d1..e2eb3a7 100644
--- a/src/main/java/com/fzzy/api/utils/AESUtils.java
+++ b/src/main/java/com/fzzy/api/utils/AESUtils.java
@@ -1,7 +1,6 @@
package com.fzzy.api.utils;
import javax.crypto.Cipher;
-import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
diff --git a/src/main/java/com/fzzy/api/utils/ContextUtil.java b/src/main/java/com/fzzy/api/utils/ContextUtil.java
index 92e0c24..a88a81c 100644
--- a/src/main/java/com/fzzy/api/utils/ContextUtil.java
+++ b/src/main/java/com/fzzy/api/utils/ContextUtil.java
@@ -101,9 +101,6 @@
// int i = ContextUtil.getMinuteOfHour(date);
//
// System.out.println(i);
- String str = null;
- String [] s= str.split("-");
- System.out.println( Integer.valueOf(s[0]));
}
diff --git a/src/main/java/com/fzzy/api/utils/ShRSAUtils.java b/src/main/java/com/fzzy/api/utils/ShRSAUtils.java
index b9f6503..01d7a66 100644
--- a/src/main/java/com/fzzy/api/utils/ShRSAUtils.java
+++ b/src/main/java/com/fzzy/api/utils/ShRSAUtils.java
@@ -1,13 +1,11 @@
package com.fzzy.api.utils;
-;
import org.apache.commons.codec.binary.Base64;
import javax.crypto.Cipher;
import java.io.ByteArrayOutputStream;
-import java.nio.charset.StandardCharsets;
import java.security.*;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
diff --git a/src/main/java/com/fzzy/conf/WebsocketConfig.java b/src/main/java/com/fzzy/conf/WebsocketConfig.java
new file mode 100644
index 0000000..6503795
--- /dev/null
+++ b/src/main/java/com/fzzy/conf/WebsocketConfig.java
@@ -0,0 +1,17 @@
+package com.fzzy.conf;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.socket.server.standard.ServerEndpointExporter;
+
+/**
+ * 椤圭洰浣跨敤WEbSocket閰嶇疆
+ */
+@Configuration
+public class WebsocketConfig {
+
+ @Bean
+ public ServerEndpointExporter serverEndpointExporter() {
+ return new ServerEndpointExporter();
+ }
+}
diff --git a/src/main/java/com/fzzy/gateway/GatewayRunner.java b/src/main/java/com/fzzy/gateway/GatewayRunner.java
new file mode 100644
index 0000000..b841244
--- /dev/null
+++ b/src/main/java/com/fzzy/gateway/GatewayRunner.java
@@ -0,0 +1,30 @@
+package com.fzzy.gateway;
+import com.fzzy.api.service.ApiCommonService;
+import com.fzzy.api.service.ApiTriggerService;
+import com.fzzy.api.service.GbCheckItemService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.CommandLineRunner;
+import org.springframework.core.annotation.Order;
+import org.springframework.stereotype.Service;
+
+/**
+ * 閰嶇疆闅忕郴缁熷惎鍔ㄩ粯璁ら厤缃�
+ */
+@Service
+@Slf4j
+@Order(value = 2)
+public class GatewayRunner implements CommandLineRunner {
+
+
+ @Override
+ public void run(String... args) throws Exception {
+ log.info("缃戝叧鎺ュ彛闅忕郴缁熷惎鍔�------------");
+
+
+ //鍥涘窛缃戝叧鎺ュ彛锛屽惎鍔ㄩ粯璁よ幏鍙栭壌鏉冧俊鎭紝闀挎湡鏈夋晥
+
+
+ }
+
+}
diff --git a/src/main/java/com/fzzy/gateway/entity/GatewayConf.java b/src/main/java/com/fzzy/gateway/entity/GatewayConf.java
new file mode 100644
index 0000000..8d14917
--- /dev/null
+++ b/src/main/java/com/fzzy/gateway/entity/GatewayConf.java
@@ -0,0 +1,60 @@
+package com.fzzy.gateway.entity;
+
+import com.bstek.dorado.annotation.PropertyDef;
+import com.fzzy.api.Constant;
+import lombok.Data;
+
+import javax.persistence.*;
+import java.io.Serializable;
+
+/**
+ * 缃戝叧閰嶇疆
+ */
+@Data
+@Entity
+@Table(name = "G_CONF")
+public class GatewayConf implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 8687625896329163486L;
+
+ @Id
+ @PropertyDef(label = "搴撳尯浠g爜")
+ @Column(name = "kqdm", length = 50)
+ private String kqdm;
+
+ @PropertyDef(label = "搴撳尯鍚嶇О")
+ @Column(name = "kqmc", length = 100)
+ private String kqmc;
+
+ @PropertyDef(label = "鐢ㄦ埛鍚�")
+ @Column(name = "username", length = 50)
+ private String userName;
+
+ @PropertyDef(label = "瀵嗙爜")
+ @Column(name = "password", length = 50)
+ private String password;
+
+ @PropertyDef(label = "鐪佸钩鍙板姞瀵嗗叕閽�")
+ @Column(name = "publicKey", length = 200)
+ private String publicKey;
+
+ @PropertyDef(label = "鐪佸钩鍙版帴鍙e湴鍧�")
+ @Column(name = "apiUrl", length = 200)
+ private String apiUrl;
+
+ @PropertyDef(label = "鎺ㄩ�佸崗璁�")
+ @Column(name = "pushProtocol", length = 20)
+ private String pushProtocol;
+
+ @PropertyDef(label = "绮簱绯荤粺搴撳尯浠g爜")
+ @Column(name = "deptId", length = 50)
+ private String deptId;
+
+ @PropertyDef(label = "鏄惁涓婄嚎")
+ @Column(name = "exe_tag", length = 2)
+ private String exeTag = Constant.YN_Y;
+
+}
diff --git a/src/main/java/com/fzzy/gateway/package-info.java b/src/main/java/com/fzzy/gateway/package-info.java
new file mode 100644
index 0000000..7353582
--- /dev/null
+++ b/src/main/java/com/fzzy/gateway/package-info.java
@@ -0,0 +1,4 @@
+/**
+ * 缃戝叧鎺ュ彛
+ */
+package com.fzzy.gateway;
\ No newline at end of file
diff --git a/src/main/java/com/fzzy/gateway/sc2023/ScConstant.java b/src/main/java/com/fzzy/gateway/sc2023/ScConstant.java
new file mode 100644
index 0000000..1343dbb
--- /dev/null
+++ b/src/main/java/com/fzzy/gateway/sc2023/ScConstant.java
@@ -0,0 +1,15 @@
+package com.fzzy.gateway.sc2023;
+
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 甯搁噺
+ */
+public class ScConstant {
+
+
+ public static Map<String,String> contextToken = new HashMap<>();
+
+}
diff --git a/src/main/java/com/fzzy/gateway/sc2023/api/ApiInitService.java b/src/main/java/com/fzzy/gateway/sc2023/api/ApiInitService.java
new file mode 100644
index 0000000..0a7a50c
--- /dev/null
+++ b/src/main/java/com/fzzy/gateway/sc2023/api/ApiInitService.java
@@ -0,0 +1,15 @@
+package com.fzzy.gateway.sc2023.api;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+/**
+ * 褰撳墠鎺ュ彛锛屽垵濮嬪寲鐩稿叧
+ */
+@Slf4j
+@Component
+public class ApiInitService {
+
+
+
+}
diff --git a/src/main/java/com/fzzy/gateway/sc2023/package-info.java b/src/main/java/com/fzzy/gateway/sc2023/package-info.java
new file mode 100644
index 0000000..d6d6127
--- /dev/null
+++ b/src/main/java/com/fzzy/gateway/sc2023/package-info.java
@@ -0,0 +1,5 @@
+/**
+ * 鍥涘窛鐪�-2023骞存帴鍙�
+ */
+package com.fzzy.gateway.sc2023;
+
diff --git a/src/main/java/com/fzzy/gateway/sc2023/websocket/WebSocketMqtt.java b/src/main/java/com/fzzy/gateway/sc2023/websocket/WebSocketMqtt.java
new file mode 100644
index 0000000..ddd20dd
--- /dev/null
+++ b/src/main/java/com/fzzy/gateway/sc2023/websocket/WebSocketMqtt.java
@@ -0,0 +1,78 @@
+package com.fzzy.gateway.sc2023.websocket;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+import javax.websocket.*;
+import javax.websocket.server.PathParam;
+import javax.websocket.server.ServerEndpoint;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ *
+ */
+@Slf4j
+@Component
+@ServerEndpoint(value = "/mqtt")
+public class WebSocketMqtt {
+
+ private static Map<String, Session> sessionPool = new ConcurrentHashMap<>();
+
+ // 涓庢煇涓鎴风鐨勮繛鎺ヤ細璇濓紝闇�瑕侀�氳繃瀹冩潵缁欏鎴风鍙戦�佹暟鎹�
+ private Session session;
+
+ private String key;
+
+ @OnOpen
+ public void onOpen(Session session,
+ @PathParam("keepalive") String keepalive,
+ @PathParam("clientId") String clientId,
+ @PathParam("protocolId") String protocolId,
+ @PathParam("protocolVersion") String protocolVersion,
+ @PathParam("clean") String clean,
+ @PathParam("reconnectPeriod") String reconnectPeriod,
+ @PathParam("reconnectTimeout") String reconnectTimeout
+ ) throws Exception {
+
+ this.session = session;
+
+ key = clientId;
+
+ sessionPool.put(key, session);
+
+
+ log.info("new webSocket,clientId={}", key);
+ }
+
+ @OnClose
+ public void onClose() {
+
+ sessionPool.remove(key);
+
+ log.info("WebSocket杩炴帴鍏抽棴={}", key);
+
+ }
+
+ /**
+ * 鏀跺埌鍓嶇鍙戦�佺殑淇℃伅
+ *
+ * @param message
+ * @param session
+ */
+ @OnMessage
+ public void onMessage(String message, Session session) {
+
+ log.info("鏉ヨ嚜瀹㈡埛绔俊鎭�:\n" + message);
+ }
+
+ @OnError
+ public void onError(Session session, Throwable error) {
+ log.error("鍙戠敓閿欒");
+
+ sessionPool.remove(key);
+
+ error.printStackTrace();
+ }
+
+}
diff --git a/src/main/java/com/fzzy/mqtt/MqttAcceptCallback.java b/src/main/java/com/fzzy/mqtt/MqttAcceptCallback.java
new file mode 100644
index 0000000..94ace07
--- /dev/null
+++ b/src/main/java/com/fzzy/mqtt/MqttAcceptCallback.java
@@ -0,0 +1,90 @@
+package com.fzzy.mqtt;
+
+import lombok.extern.slf4j.Slf4j;
+import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken;
+import org.eclipse.paho.client.mqttv3.MqttCallbackExtended;
+import org.eclipse.paho.client.mqttv3.MqttMessage;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description : MQTT鎺ュ彈鏈嶅姟鐨勫洖璋冪被
+ */
+@Slf4j
+@Component
+public class MqttAcceptCallback implements MqttCallbackExtended {
+
+ @Autowired
+ private MqttAcceptClient mqttAcceptClient;
+
+ @Autowired
+ private MqttProperties mqttProperties;
+
+
+ /**
+ * 瀹㈡埛绔柇寮�鍚庤Е鍙�
+ *
+ * @param throwable
+ */
+ @Override
+ public void connectionLost(Throwable throwable) {
+ log.info("杩炴帴鏂紑锛屽彲浠ラ噸杩�");
+ if (MqttAcceptClient.client == null || !MqttAcceptClient.client.isConnected()) {
+ log.info("銆恊mqx閲嶆柊杩炴帴銆�....................................................");
+ mqttAcceptClient.reconnection();
+ }
+ }
+
+
+ /**
+ * 瀹㈡埛绔敹鍒版秷鎭Е鍙�
+ *
+ * @param topic 涓婚
+ * @param mqttMessage 娑堟伅
+ */
+ @Override
+ public void messageArrived(String topic, MqttMessage mqttMessage) throws Exception {
+ log.info("銆愭帴鏀舵秷鎭富棰樸��:" + topic);
+ log.info("銆愭帴鏀舵秷鎭疩os銆�:" + mqttMessage.getQos());
+ log.info("銆愭帴鏀舵秷鎭唴瀹广��:" + new String(mqttMessage.getPayload()));
+ // int i = 1/0;
+ }
+
+
+ /**
+ * 鍙戝竷娑堟伅鎴愬姛
+ *
+ * @param token token
+ */
+ @Override
+ public void deliveryComplete(IMqttDeliveryToken token) {
+ String[] topics = token.getTopics();
+ for (String topic : topics) {
+ log.info("鍚戜富棰樸��" + topic + "銆戝彂閫佹秷鎭垚鍔燂紒");
+ }
+ try {
+ MqttMessage message = token.getMessage();
+ byte[] payload = message.getPayload();
+ String s = new String(payload, "UTF-8");
+ log.info("銆愭秷鎭唴瀹广��:" + s);
+ } catch (Exception e) {
+ log.error("MqttAcceptCallback deliveryComplete error,message:{}", e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * 杩炴帴emq鏈嶅姟鍣ㄥ悗瑙﹀彂
+ *
+ * @param b
+ * @param s
+ */
+ @Override
+ public void connectComplete(boolean b, String s) {
+ log.info("============================= 瀹㈡埛绔��" + MqttAcceptClient.client.getClientId() + "銆戣繛鎺ユ垚鍔燂紒=============================");
+ // 浠�/#缁撳熬琛ㄧず璁㈤槄鎵�鏈変互test寮�澶寸殑涓婚
+ // 璁㈤槄鎵�鏈夋満鏋勪富棰�
+ mqttAcceptClient.subscribe(mqttProperties.getDefaultTopic(), 0);
+ }
+
+}
diff --git a/src/main/java/com/fzzy/mqtt/MqttAcceptClient.java b/src/main/java/com/fzzy/mqtt/MqttAcceptClient.java
new file mode 100644
index 0000000..a7823ad
--- /dev/null
+++ b/src/main/java/com/fzzy/mqtt/MqttAcceptClient.java
@@ -0,0 +1,104 @@
+package com.fzzy.mqtt;
+
+import lombok.extern.slf4j.Slf4j;
+import org.eclipse.paho.client.mqttv3.MqttClient;
+import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
+import org.eclipse.paho.client.mqttv3.MqttException;
+import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description : MQTT鎺ュ彈鏈嶅姟鐨勫鎴风
+ */
+@Slf4j
+@Component
+public class MqttAcceptClient {
+
+ @Autowired
+ private MqttAcceptCallback mqttAcceptCallback;
+
+ @Autowired
+ private MqttProperties mqttProperties;
+
+ public static MqttClient client;
+
+ private static MqttClient getClient() {
+ return client;
+ }
+
+ private static void setClient(MqttClient client) {
+ MqttAcceptClient.client = client;
+ }
+
+
+ /**
+ * 瀹㈡埛绔繛鎺�
+ */
+ public void connect() {
+ MqttClient client;
+ try {
+ client = new MqttClient(mqttProperties.getHost(), mqttProperties.getClientId(),
+ new MemoryPersistence());
+
+ MqttConnectOptions options = new MqttConnectOptions();
+ options.setUserName(mqttProperties.getClientUsername());
+ options.setPassword(mqttProperties.getClientPassword().toCharArray());
+ options.setConnectionTimeout(mqttProperties.getClientTimeout());
+ options.setKeepAliveInterval(mqttProperties.getClientAliveTime());
+ options.setAutomaticReconnect(mqttProperties.getReconnect());
+ options.setCleanSession(mqttProperties.getCleanSession());
+ MqttAcceptClient.setClient(client);
+ // 璁剧疆鍥炶皟
+ client.setCallback(mqttAcceptCallback);
+ client.connect(options);
+ } catch (Exception e) {
+ log.error("MqttAcceptClient connect error,message:{}", e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * 閲嶆柊杩炴帴
+ */
+ public void reconnection() {
+ try {
+ client.connect();
+ } catch (MqttException e) {
+ log.error("MqttAcceptClient reconnection error,message:{}", e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * 璁㈤槄鏌愪釜涓婚
+ *
+ * @param topic 涓婚
+ * @param qos 杩炴帴鏂瑰紡
+ */
+ public void subscribe(String topic, int qos) {
+ log.info("========================銆愬紑濮嬭闃呬富棰�:" + topic + "銆�========================");
+ try {
+ client.subscribe(topic, qos);
+ } catch (MqttException e) {
+ log.error("MqttAcceptClient subscribe error,message:{}", e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * 鍙栨秷璁㈤槄鏌愪釜涓婚
+ *
+ * @param topic
+ */
+ public void unsubscribe(String topic) {
+ log.info("========================銆愬彇娑堣闃呬富棰�:" + topic + "銆�========================");
+ try {
+ client.unsubscribe(topic);
+ } catch (MqttException e) {
+ log.error("MqttAcceptClient unsubscribe error,message:{}", e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/src/main/java/com/fzzy/mqtt/MqttCondition.java b/src/main/java/com/fzzy/mqtt/MqttCondition.java
new file mode 100644
index 0000000..f335e7b
--- /dev/null
+++ b/src/main/java/com/fzzy/mqtt/MqttCondition.java
@@ -0,0 +1,25 @@
+package com.fzzy.mqtt;
+
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.context.annotation.Condition;
+import org.springframework.context.annotation.ConditionContext;
+import org.springframework.core.env.Environment;
+import org.springframework.core.type.AnnotatedTypeMetadata;
+
+/**
+ * @Description : 鑷畾涔夐厤缃�,閫氳繃杩欎釜閰嶇疆锛屾潵鎺у埗鍚姩椤圭洰鐨勬椂鍊欐槸鍚﹀惎鍔╩qtt
+ */
+public class MqttCondition implements Condition {
+
+ @Override
+ public boolean matches(ConditionContext context, AnnotatedTypeMetadata annotatedTypeMetadata) {
+ //1銆佽兘鑾峰彇鍒癷oc浣跨敤鐨刡eanfactory
+ ConfigurableListableBeanFactory beanFactory = context.getBeanFactory();
+ //2銆佽幏鍙栫被鍔犺浇鍣�
+ ClassLoader classLoader = context.getClassLoader();
+ //3銆佽幏鍙栧綋鍓嶇幆澧冧俊鎭�
+ Environment environment = context.getEnvironment();
+ String isOpen = environment.getProperty("mqtt.isOpen");
+ return Boolean.valueOf(isOpen);
+ }
+}
diff --git a/src/main/java/com/fzzy/mqtt/MqttProperties.java b/src/main/java/com/fzzy/mqtt/MqttProperties.java
new file mode 100644
index 0000000..8a7a554
--- /dev/null
+++ b/src/main/java/com/fzzy/mqtt/MqttProperties.java
@@ -0,0 +1,78 @@
+package com.fzzy.mqtt;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * MQTT 閰嶇疆淇℃伅
+ */
+@Component
+@ConfigurationProperties("mqtt")
+@Data
+public class MqttProperties {
+
+ /**
+ * 杩炴帴鍦板潃
+ */
+ private String host;
+
+ /**
+ * 鐢ㄦ埛鍚�
+ */
+ private String clientUsername;
+
+ /**
+ * 瀵嗙爜
+ */
+ private String clientPassword;
+
+
+ /**
+ * 瀹㈡埛绔疘d锛屽悓涓�鍙版湇鍔″櫒涓嬶紝涓嶅厑璁稿嚭鐜伴噸澶嶇殑瀹㈡埛绔痠d
+ */
+ private String clientId;
+
+
+ /**
+ * 瓒呮椂鏃堕棿
+ */
+ private int clientTimeout;
+
+ /**
+ * 璁剧疆浼氳瘽蹇冭烦鏃堕棿 鍗曚綅涓虹 鏈嶅姟鍣ㄤ細姣忛殧1.5*20绉掔殑鏃堕棿鍚戝鎴风
+ * 鍙戦�佷釜娑堟伅鍒ゆ柇瀹㈡埛绔槸鍚﹀湪绾匡紝浣嗚繖涓柟娉曞苟娌℃湁閲嶈繛鐨勬満鍒�
+ */
+ private int clientAliveTime;
+
+ private int clientMaxConnectTime;
+
+ private String clientTopics;
+
+ /**
+ * 杩炴帴鏂瑰紡
+ */
+ private Integer clientQos;
+
+ /**
+ * 榛樿杩炴帴涓婚锛屼互/#缁撳熬琛ㄧず璁㈤槄鎵�鏈変互test寮�澶寸殑涓婚
+ */
+ private String defaultTopic;
+
+ /**
+ * 璁剧疆鏄惁娓呯┖session,杩欓噷濡傛灉璁剧疆涓篺alse琛ㄧず鏈嶅姟鍣ㄤ細淇濈暀瀹㈡埛绔殑杩�
+ * 鎺ヨ褰曪紝杩欓噷璁剧疆涓簍rue琛ㄧず姣忔杩炴帴鍒版湇鍔″櫒閮戒互鏂扮殑韬唤杩炴帴
+ */
+ private Boolean cleanSession;
+
+ /**
+ * 鏄惁鏂嚎閲嶈繛
+ */
+ private Boolean reconnect;
+
+ /**
+ * 鍚姩鐨勬椂鍊欐槸鍚﹀叧闂璵qtt
+ */
+ private Boolean isOpen;
+
+}
diff --git a/src/main/java/com/fzzy/sys/RolePR.java b/src/main/java/com/fzzy/sys/RolePR.java
index bc8b753..7f9faff 100644
--- a/src/main/java/com/fzzy/sys/RolePR.java
+++ b/src/main/java/com/fzzy/sys/RolePR.java
@@ -15,11 +15,9 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.stream.Collectors;
/**
* 鏉冮檺缁存姢
diff --git a/src/main/java/com/fzzy/sys/UserPR.java b/src/main/java/com/fzzy/sys/UserPR.java
index a2d884d..ab3a1f0 100644
--- a/src/main/java/com/fzzy/sys/UserPR.java
+++ b/src/main/java/com/fzzy/sys/UserPR.java
@@ -5,19 +5,13 @@
import com.bstek.dorado.annotation.Expose;
import com.bstek.dorado.data.entity.EntityState;
import com.bstek.dorado.data.entity.EntityUtils;
-import com.fzzy.api.Constant;
import com.fzzy.sys.entity.SysUser;
import com.fzzy.sys.repository.UserRepository;
import org.apache.commons.lang.math.RandomUtils;
-import org.bouncycastle.crypto.generators.BCrypt;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
-import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;
-import javax.annotation.Resource;
-import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -31,7 +25,6 @@
@Autowired
private UserRepository userRepository;
- private BCryptPasswordEncoder bCryptPasswordEncoder;
/**
* sys.userPR#findAll
@@ -65,10 +58,10 @@
//瀵嗙爜鍔犲瘑
int salt = RandomUtils.nextInt(27);
salt += 4;
- bCryptPasswordEncoder = new BCryptPasswordEncoder(salt);
- String password = bCryptPasswordEncoder.encode(entity.getPassword());
+// bCryptPasswordEncoder = new BCryptPasswordEncoder(salt);
+// String password = bCryptPasswordEncoder.encode(entity.getPassword());
// boolean b= bCryptPasswordEncoder.matches(entity.getPassword(),password);
- entity.setPassword(password);
+ entity.setPassword(entity.getPassword());
entity.setSalt(String.valueOf(salt));
}
// 鎵嬪姩灏哾oradoEntity瀵硅薄杞崲涓烘爣鍑咮ean瀵硅薄
@@ -101,9 +94,9 @@
//瀵嗙爜鍔犲瘑
int salt = RandomUtils.nextInt(27);
salt += 4;
- bCryptPasswordEncoder = new BCryptPasswordEncoder(salt);
- String password = bCryptPasswordEncoder.encode(Constant.DEFAULT_USER_PASSWORD);
- entity.setPassword(password);
+// bCryptPasswordEncoder = new BCryptPasswordEncoder(salt);
+// String password = bCryptPasswordEncoder.encode(Constant.DEFAULT_USER_PASSWORD);
+ entity.setPassword(entity.getPassword());
entity.setSalt(String.valueOf(salt));
SysUser data = new SysUser();
diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml
index b97f857..16306b2 100644
--- a/src/main/resources/application-dev.yml
+++ b/src/main/resources/application-dev.yml
@@ -5,41 +5,43 @@
datasource:
#涓绘暟鎹簮
primary:
-# url: jdbc:mysql://127.0.0.1:3306/igds_api_5016?useUnicode=true&useSSL=false&characterEncoding=utf-8 #澶ф咕鍖�
-# url: jdbc:mysql://127.0.0.1:3306/igds_api_5303?useUnicode=true&useSSL=false&characterEncoding=utf-8 #涓婃捣鍢夊畾
-# url: jdbc:mysql://127.0.0.1:3306/igds_api_5311?useUnicode=true&useSSL=false&characterEncoding=utf-8 #骞挎境
-# url: jdbc:mysql://127.0.0.1:3306/igds_api_5317?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼搴�
-# url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_002?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼鍒嗗簱-婵犳睙鍖虹璧佸簱
-# url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_1?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼-娓彛鏂颁粨
-# url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_2?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼-鍏冲煚鑰佷粨
-# url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_3?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼-鐩村睘浠撳簱
-# url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_4?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼-瑗胯儶-鏂颁粨绮簱
-# url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_4_2?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼-瑗胯儶-涓滃嚖绮簱
-# url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_5?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼-閲戠伓涓�鎵�绮簱
-# url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_6?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼-閲戠伓浜屾墍绮簱
-# url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_7?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼-绮补杞繍绔�
-# url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_8?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼-娌虫邯绮墍
-# url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_9?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼-娴烽棬绮墍
-# url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_10?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼-鍜屽钩绮墍
-# url: jdbc:mysql://127.0.0.1:3306/igds_api_5320?useUnicode=true&useSSL=false&characterEncoding=utf-8 #骞夸笢鍙板北
-# url: jdbc:mysql://127.0.0.1:3306/igds_api_5321?useUnicode=true&useSSL=false&characterEncoding=utf-8 #骞夸笢闊跺叧
-# url: jdbc:mysql://127.0.0.1:3306/igds_api_5322?useUnicode=true&useSSL=false&characterEncoding=utf-8 #骞夸笢寰愰椈
- url: jdbc:mysql://127.0.0.1:3306/igds_api_5326?useUnicode=true&useSSL=false&characterEncoding=utf-8 #鎯犲窞鎯犳柊
-# url: jdbc:mysql://127.0.0.1:3306/igds_api_5327?useUnicode=true&useSSL=false&characterEncoding=utf-8 #姝︽眽榛勯檪鍐涚伯
+ url: jdbc:mysql://127.0.0.1:3306/igds_api?useUnicode=true&useSSL=false&characterEncoding=utf-8
+ # url: jdbc:mysql://127.0.0.1:3306/igds_api_5016?useUnicode=true&useSSL=false&characterEncoding=utf-8 #澶ф咕鍖�
+ # url: jdbc:mysql://127.0.0.1:3306/igds_api_5303?useUnicode=true&useSSL=false&characterEncoding=utf-8 #涓婃捣鍢夊畾
+ # url: jdbc:mysql://127.0.0.1:3306/igds_api_5311?useUnicode=true&useSSL=false&characterEncoding=utf-8 #骞挎境
+ # url: jdbc:mysql://127.0.0.1:3306/igds_api_5317?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼搴�
+ # url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_002?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼鍒嗗簱-婵犳睙鍖虹璧佸簱
+ # url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_1?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼-娓彛鏂颁粨
+ # url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_2?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼-鍏冲煚鑰佷粨
+ # url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_3?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼-鐩村睘浠撳簱
+ # url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_4?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼-瑗胯儶-鏂颁粨绮簱
+ # url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_4_2?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼-瑗胯儶-涓滃嚖绮簱
+ # url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_5?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼-閲戠伓涓�鎵�绮簱
+ # url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_6?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼-閲戠伓浜屾墍绮簱
+ # url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_7?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼-绮补杞繍绔�
+ # url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_8?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼-娌虫邯绮墍
+ # url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_9?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼-娴烽棬绮墍
+ # url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_10?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼-鍜屽钩绮墍
+ # url: jdbc:mysql://127.0.0.1:3306/igds_api_5320?useUnicode=true&useSSL=false&characterEncoding=utf-8 #骞夸笢鍙板北
+ # url: jdbc:mysql://127.0.0.1:3306/igds_api_5321?useUnicode=true&useSSL=false&characterEncoding=utf-8 #骞夸笢闊跺叧
+ # url: jdbc:mysql://127.0.0.1:3306/igds_api_5322?useUnicode=true&useSSL=false&characterEncoding=utf-8 #骞夸笢寰愰椈
+ # url: jdbc:mysql://127.0.0.1:3306/igds_api_5326?useUnicode=true&useSSL=false&characterEncoding=utf-8 #鎯犲窞鎯犳柊
+ # url: jdbc:mysql://127.0.0.1:3306/igds_api_5327?useUnicode=true&useSSL=false&characterEncoding=utf-8 #姝︽眽榛勯檪鍐涚伯
username: root
password: Abc123..
driver-class-name: com.mysql.jdbc.Driver
#娆℃暟鎹簮
secondary:
-# url: jdbc:mysql://127.0.0.1:3306/igds_3.5_5016?useUnicode=true&useSSL=false&characterEncoding=utf-8 #澶ф咕鍖�
-# url: jdbc:mysql://127.0.0.1:3306/igds_3.5_5303?useUnicode=true&useSSL=false&characterEncoding=utf-8 #涓婃捣鍢夊畾
-# url: jdbc:mysql://127.0.0.1:3306/igds_3.5_5311?useUnicode=true&useSSL=false&characterEncoding=utf-8 #骞挎境
-# url: jdbc:mysql://127.0.0.1:3306/igds_3.5_5317?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼
-# url: jdbc:mysql://127.0.0.1:3306/igds_3.5_5320?useUnicode=true&useSSL=false&characterEncoding=utf-8
-# url: jdbc:mysql://127.0.0.1:3306/igds_3.5_5321?useUnicode=true&useSSL=false&characterEncoding=utf-8
-# url: jdbc:mysql://127.0.0.1:3306/igds_4.0_5322?useUnicode=true&useSSL=false&characterEncoding=utf-8 #骞夸笢寰愰椈
- url: jdbc:mysql://127.0.0.1:3306/igds_4.0_5326?useUnicode=true&useSSL=false&characterEncoding=utf-8 #鎯犲窞鎯犳柊
-# url: jdbc:mysql://127.0.0.1:3306/igds_4.0_5327?useUnicode=true&useSSL=false&characterEncoding=utf-8 #姝︽眽榛勯檪鍐涚伯
+ url: jdbc:mysql://127.0.0.1:3306/igds_v40?useUnicode=true&useSSL=false&characterEncoding=utf-8
+ # url: jdbc:mysql://127.0.0.1:3306/igds_3.5_5016?useUnicode=true&useSSL=false&characterEncoding=utf-8 #澶ф咕鍖�
+ # url: jdbc:mysql://127.0.0.1:3306/igds_3.5_5303?useUnicode=true&useSSL=false&characterEncoding=utf-8 #涓婃捣鍢夊畾
+ # url: jdbc:mysql://127.0.0.1:3306/igds_3.5_5311?useUnicode=true&useSSL=false&characterEncoding=utf-8 #骞挎境
+ # url: jdbc:mysql://127.0.0.1:3306/igds_3.5_5317?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娼槼
+ # url: jdbc:mysql://127.0.0.1:3306/igds_3.5_5320?useUnicode=true&useSSL=false&characterEncoding=utf-8
+ # url: jdbc:mysql://127.0.0.1:3306/igds_3.5_5321?useUnicode=true&useSSL=false&characterEncoding=utf-8
+ # url: jdbc:mysql://127.0.0.1:3306/igds_4.0_5322?useUnicode=true&useSSL=false&characterEncoding=utf-8 #骞夸笢寰愰椈
+ # url: jdbc:mysql://127.0.0.1:3306/igds_4.0_5326?useUnicode=true&useSSL=false&characterEncoding=utf-8 #鎯犲窞鎯犳柊
+ # url: jdbc:mysql://127.0.0.1:3306/igds_4.0_5327?useUnicode=true&useSSL=false&characterEncoding=utf-8 #姝︽眽榛勯檪鍐涚伯
username: root
password: Abc123..
driver-class-name: com.mysql.jdbc.Driver
@@ -65,11 +67,23 @@
database: 5
host: 127.0.0.1
port: 6379
- password: Abc123..
+ password: Redispwd..
# 杩炴帴姹犳渶澶ц繛鎺ユ暟锛堜娇鐢ㄨ礋鍊艰〃绀烘病鏈夐檺鍒讹級
pool:
max-active: 200
max-wait: -1
max-idle: 10
min-idle: 0
- timeout: 6000
\ No newline at end of file
+ timeout: 6000
+
+mqtt:
+ host: tcp://10.13.4.84:11883
+ client-id:
+ client-username:
+ client-password:
+ client-timeout: 10
+ client-alive-time: 20
+ client-max-connect-times: 5
+ client-topics:
+ client-qos: 0
+ isOpen: false
diff --git a/src/main/resources/application-gateway.yml b/src/main/resources/application-gateway.yml
new file mode 100644
index 0000000..ae10889
--- /dev/null
+++ b/src/main/resources/application-gateway.yml
@@ -0,0 +1,57 @@
+########################## 缃戝叧妯″紡鎺ュ彛 ##########################
+server:
+ port: 8083
+ jetty:
+ max-http-post-size: 209715200
+ tomcat:
+ max-http-post-size: 209715200
+spring:
+ datasource:
+ #涓绘暟鎹簮
+ primary:
+ url: jdbc:mysql://127.0.0.1:3306/igds_api?useUnicode=true&characterEncoding=utf-8
+ username: root
+ password: Abc123..
+ driver-class-name: com.mysql.jdbc.Driver
+ #娆℃暟鎹簮
+ secondary:
+ url: jdbc:mysql://127.0.0.1:3306/igds_master?useUnicode=true&characterEncoding=utf-8
+ username: root
+ password: Abc123..
+ driver-class-name: com.mysql.jdbc.Driver
+ jpa:
+ #涓籮pa閰嶇疆
+ primary:
+ show-sql: true
+ properties:
+ hibernate:
+ hbm2ddl:
+ auto: update
+ dialect: org.hibernate.dialect.MySQL5InnoDBDialect
+ #娆pa閰嶇疆
+ secondary:
+ show-sql: true
+ properties:
+ hibernate:
+ hbm2ddl:
+ auto: none
+ dialect: org.hibernate.dialect.MySQL5InnoDBDialect
+ # Redis鐩稿叧閰嶇疆
+ redis:
+ database: 1
+ host: 127.0.0.1
+ port: 6379
+ password: Redispwd..
+ # 杩炴帴姹犳渶澶ц繛鎺ユ暟锛堜娇鐢ㄨ礋鍊艰〃绀烘病鏈夐檺鍒讹級
+ pool:
+ max-active: 200
+ max-wait: -1
+ max-idle: 10
+ min-idle: 0
+ timeout: 6000
+igds:
+ default:
+ companyId: 5326
+
+ file-path: D:/IGDS-API/FILE/
+ img-path: D:/IGDS/FILE/
\ No newline at end of file
diff --git a/src/main/resources/application-pro.yml b/src/main/resources/application-pro.yml
index 46074c8..b54b5cc 100644
--- a/src/main/resources/application-pro.yml
+++ b/src/main/resources/application-pro.yml
@@ -41,7 +41,7 @@
database: 1
host: 127.0.0.1
port: 6379
- password: Abc123..
+ password: Redispwd..
# 杩炴帴姹犳渶澶ц繛鎺ユ暟锛堜娇鐢ㄨ礋鍊艰〃绀烘病鏈夐檺鍒讹級
pool:
max-active: 200
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 4f73abd..a862643 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -1,7 +1,7 @@
########################## Server ##########################
spring:
profiles:
- active: pro
+ active: dev
application:
name: igds-api
main:
diff --git a/velocity.log b/velocity.log
deleted file mode 100644
index c7e7864..0000000
--- a/velocity.log
+++ /dev/null
@@ -1 +0,0 @@
-2023-09-22 16:00:01,848 - ResourceManager : unable to find resource 'com/bstek/dorado/web/resolver/ErrorPage.html' in any resource loader.
--
Gitblit v1.9.3