Unverified 提交 16d84f43 authored 作者: 姜小梨's avatar 姜小梨 提交者: Gitee

update topology/topology.md.

123
上级 f5758739
maven引入 # 组态后台集成
## maven引入
```
<dependency> <dependency>
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<artifactId>topology</artifactId> <artifactId>topology</artifactId>
<version>具体版本</version> <version>具体版本</version>
</dependency> </dependency>
```
组态说明 ## 组态说明
1. 本项目pom.xml 1. 本项目pom.xml
```
<?xml version="1.0" encoding="UTF-8"?> <?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" <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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
...@@ -153,24 +158,32 @@ maven引入 ...@@ -153,24 +158,32 @@ maven引入
</repository> </repository>
</repositories> </repositories>
</project> </project>
```
2. 配置引入程序pom.xml 2. 配置引入程序pom.xml
去掉mybatis - 去掉mybatis
```
<!-- <dependency>--> <!-- <dependency>-->
<!-- <groupId>org.mybatis.spring.boot</groupId>--> <!-- <groupId>org.mybatis.spring.boot</groupId>-->
<!-- <artifactId>mybatis-spring-boot-starter</artifactId>--> <!-- <artifactId>mybatis-spring-boot-starter</artifactId>-->
<!-- <version>2.2.0</version>--> <!-- <version>2.2.0</version>-->
<!-- </dependency>--> <!-- </dependency>-->
去掉分页 ```
- 去掉分页
```
<!-- pagehelper 分页插件 --> <!-- pagehelper 分页插件 -->
<dependency> <dependency>
<groupId>com.github.pagehelper</groupId> <groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId> <artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${pagehelper.spring.boot.starter.version}</version> <version>${pagehelper.spring.boot.starter.version}</version>
</dependency> </dependency>
```
- 如果含有mybatis的话,程序启动时会报:NoClassDefFoundError: org/mybatis/logging/LoggerFactory
● 如果含有mybatis的话,程序启动时会报:NoClassDefFoundError: org/mybatis/logging/LoggerFactory
3. 配置application.yml 3. 配置application.yml
```
mybatis-plus: mybatis-plus:
# 搜索指定包别名,;表示多个 # 搜索指定包别名,;表示多个
typeAliasesPackage: com.ruoyi.**.domain typeAliasesPackage: com.ruoyi.**.domain
...@@ -267,15 +280,18 @@ spring: ...@@ -267,15 +280,18 @@ spring:
max-active: 8 max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制) # #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms max-wait: -1ms
```
4. 配置文件说明 4. 配置文件说明
● spring.datasource.type可以自由进行配置 - spring.datasource.type:可以自由进行配置
● druid中默认数据请执行配置 - druid:中默认数据请执行配置
● redis请执行进行配置 - redis:请进行配置
● topology.profile请执行根据需求进行配置,该配置为组态存入图片具体路径 - topology.profile:请执行根据需求进行配置,该配置为组态存入图片具体路径
mybatis-plus: - mybatis-plus:
# 搜索指定包别名,;表示多个 搜索指定包别名,;表示多个
typeAliasesPackage: com.ruoyi.**.domain 需添加自己的,多个使用,;来表示 typeAliasesPackage: com.ruoyi.**.domain 需添加自己的,多个使用,;来表示
● mybatis-config.xml 如下所示: - mybatis-config.xml 如下所示:
```
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration <!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN" PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
...@@ -290,25 +306,42 @@ PUBLIC "-//mybatis.org//DTD Config 3.0//EN" ...@@ -290,25 +306,42 @@ PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
<!-- <setting name="mapUnderscoreToCamelCase" value="true"/> 驼峰式命名 --> <!-- <setting name="mapUnderscoreToCamelCase" value="true"/> 驼峰式命名 -->
</settings> </settings>
</configuration> 将文件放在resources下mybatis/mybatis-config.xml </configuration>
```
将文件放在resources下mybatis/mybatis-config.xml
5. 代码中配置 5. 代码中配置
● 如果使用spring security配置 - 如果使用spring security配置
请在SecurityConfig类configure方法中添加如下所示代码
组态接口配置 请在SecurityConfig类configure方法中添加如下所示代码<br>
组态接口配置<br>
```
.antMatchers( "/topology/listAll" ).anonymous() .antMatchers( "/topology/listAll" ).anonymous()
.antMatchers( "/topology/listAll" ).permitAll() .antMatchers( "/topology/listAll" ).permitAll()
.antMatchers( "/topology/getTopology/**" ).anonymous() .antMatchers( "/topology/getTopology/**" ).anonymous()
.antMatchers( "/topology/getTopology/**" ).permitAll() .antMatchers( "/topology/getTopology/**" ).permitAll()
.antMatchers( "/params/**" ).anonymous() .antMatchers( "/params/**" ).anonymous()
.antMatchers( "/params/**" ).permitAll() .antMatchers( "/params/**" ).permitAll()
websocket设置 ```
websocket设置
```
.antMatchers( "/topology/test" ).anonymous() .antMatchers( "/topology/test" ).anonymous()
.antMatchers( "/mqttDemo/**" ).anonymous() .antMatchers( "/mqttDemo/**" ).anonymous()
.antMatchers( "/imserver/**" ).anonymous() .antMatchers( "/imserver/**" ).anonymous()
.antMatchers( "/sendMqttMessage" ).anonymous() .antMatchers( "/sendMqttMessage" ).anonymous()
● 如果使用shiro配置 ```
请在ShiroConfig类Shiro过滤器配置中添加如下所示代码
组态接口配置 - 如果使用shiro配置
请在ShiroConfig类Shiro过滤器配置中添加如下所示代码<br>
组态接口配置<br>
```
LinkedHashMap<String, String> filterChainDefinitionMap = new LinkedHashMap<>(); LinkedHashMap<String, String> filterChainDefinitionMap = new LinkedHashMap<>();
filterChainDefinitionMap.put( "/topology/listAll", "anon"); filterChainDefinitionMap.put( "/topology/listAll", "anon");
filterChainDefinitionMap.put( "/topology/listAll", "anon"); filterChainDefinitionMap.put( "/topology/listAll", "anon");
...@@ -316,13 +349,19 @@ filterChainDefinitionMap.put( "/topology/getTopology/**" , "anon"); ...@@ -316,13 +349,19 @@ filterChainDefinitionMap.put( "/topology/getTopology/**" , "anon");
filterChainDefinitionMap.put( "/topology/getTopology/**" , "anon"); filterChainDefinitionMap.put( "/topology/getTopology/**" , "anon");
filterChainDefinitionMap.put( "/params/**" , "anon"); filterChainDefinitionMap.put( "/params/**" , "anon");
filterChainDefinitionMap.put( "/params/**" , "anon"); filterChainDefinitionMap.put( "/params/**" , "anon");
websocket设置 ```
websocket设置
```
filterChainDefinitionMap.put( "/topology/test" , "anon"); filterChainDefinitionMap.put( "/topology/test" , "anon");
filterChainDefinitionMap.put( "/mqttDemo/**" , "anon"); filterChainDefinitionMap.put( "/mqttDemo/**" , "anon");
filterChainDefinitionMap.put("/imserver/**" , "anon"); filterChainDefinitionMap.put("/imserver/**" , "anon");
filterChainDefinitionMap.put("/sendMqttMessage" , "anon"); filterChainDefinitionMap.put("/sendMqttMessage" , "anon");
```
6. sql文件 6. sql文件
```
/* /*
Navicat Premium Data Transfer Navicat Premium Data Transfer
...@@ -371,4 +410,4 @@ CREATE TABLE `images` ( ...@@ -371,4 +410,4 @@ CREATE TABLE `images` (
) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '组态图片表' ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '组态图片表' ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1; SET FOREIGN_KEY_CHECKS = 1;
```
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论