feat(ops): 增强工单队列服务并新增 RPC 配置
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,172 +1,176 @@
|
|||||||
<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 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">
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>viewsh-module-ops</artifactId>
|
<artifactId>viewsh-module-ops</artifactId>
|
||||||
<groupId>com.viewsh</groupId>
|
<groupId>com.viewsh</groupId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<artifactId>viewsh-module-ops-server</artifactId>
|
<artifactId>viewsh-module-ops-server</artifactId>
|
||||||
|
|
||||||
<name>${project.artifactId}</name>
|
<name>${project.artifactId}</name>
|
||||||
<description>
|
<description>
|
||||||
[宿主层] 独立微服务入口,聚合上述所有模块
|
[宿主层] 独立微服务入口,聚合上述所有模块
|
||||||
内部依赖流向(由低向高):ops-api → ops-biz → *-biz → ops-server
|
内部依赖流向(由低向高):ops-api → ops-biz → *-biz → ops-server
|
||||||
</description>
|
</description>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<!-- Spring Cloud 基础 -->
|
<!-- Spring Cloud 基础 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.viewsh</groupId>
|
<groupId>com.viewsh</groupId>
|
||||||
<artifactId>viewsh-spring-boot-starter-env</artifactId>
|
<artifactId>viewsh-spring-boot-starter-env</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 依赖服务 API -->
|
<!-- 依赖服务 API -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.viewsh</groupId>
|
<groupId>com.viewsh</groupId>
|
||||||
<artifactId>viewsh-module-system-api</artifactId>
|
<artifactId>viewsh-module-system-api</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.viewsh</groupId>
|
<groupId>com.viewsh</groupId>
|
||||||
<artifactId>viewsh-module-infra-api</artifactId>
|
<artifactId>viewsh-module-infra-api</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.viewsh</groupId>
|
<groupId>com.viewsh</groupId>
|
||||||
<artifactId>viewsh-module-ops-api</artifactId>
|
<artifactId>viewsh-module-ops-api</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 聚合依赖:核心层 biz 模块 -->
|
<!-- 聚合依赖:核心层 biz 模块 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.viewsh</groupId>
|
<groupId>com.viewsh</groupId>
|
||||||
<artifactId>viewsh-module-ops-biz</artifactId>
|
<artifactId>viewsh-module-ops-biz</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 聚合依赖:业务层 biz 模块(各条线实现) -->
|
<!-- 聚合依赖:业务层 biz 模块(各条线实现) -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.viewsh</groupId>
|
<groupId>com.viewsh</groupId>
|
||||||
<artifactId>viewsh-module-environment-biz</artifactId>
|
<artifactId>viewsh-module-environment-biz</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.viewsh</groupId>
|
<groupId>com.viewsh</groupId>
|
||||||
<artifactId>viewsh-module-security-biz</artifactId>
|
<artifactId>viewsh-module-security-biz</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.viewsh</groupId>
|
<groupId>com.viewsh</groupId>
|
||||||
<artifactId>viewsh-module-facilities-biz</artifactId>
|
<artifactId>viewsh-module-facilities-biz</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.viewsh</groupId>
|
<groupId>com.viewsh</groupId>
|
||||||
<artifactId>viewsh-module-service-biz</artifactId>
|
<artifactId>viewsh-module-service-biz</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<!-- 业务组件 -->
|
<!-- 业务组件 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.viewsh</groupId>
|
<groupId>com.viewsh</groupId>
|
||||||
<artifactId>viewsh-spring-boot-starter-biz-data-permission</artifactId>
|
<artifactId>viewsh-spring-boot-starter-biz-data-permission</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.viewsh</groupId>
|
<groupId>com.viewsh</groupId>
|
||||||
<artifactId>viewsh-spring-boot-starter-biz-tenant</artifactId>
|
<artifactId>viewsh-spring-boot-starter-biz-tenant</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Web 相关 -->
|
<!-- Web 相关 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.viewsh</groupId>
|
<groupId>com.viewsh</groupId>
|
||||||
<artifactId>viewsh-spring-boot-starter-web</artifactId>
|
<artifactId>viewsh-spring-boot-starter-web</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.viewsh</groupId>
|
<groupId>com.viewsh</groupId>
|
||||||
<artifactId>viewsh-spring-boot-starter-security</artifactId>
|
<artifactId>viewsh-spring-boot-starter-security</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- DB 相关 -->
|
<!-- DB 相关 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.viewsh</groupId>
|
<groupId>com.viewsh</groupId>
|
||||||
<artifactId>viewsh-spring-boot-starter-mybatis</artifactId>
|
<artifactId>viewsh-spring-boot-starter-mybatis</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.viewsh</groupId>
|
<groupId>com.viewsh</groupId>
|
||||||
<artifactId>viewsh-spring-boot-starter-redis</artifactId>
|
<artifactId>viewsh-spring-boot-starter-redis</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- RPC 远程调用相关 -->
|
<!-- RPC 远程调用相关 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.viewsh</groupId>
|
<groupId>com.viewsh</groupId>
|
||||||
<artifactId>viewsh-spring-boot-starter-rpc</artifactId>
|
<artifactId>viewsh-spring-boot-starter-rpc</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Registry 注册中心相关 -->
|
<!-- Registry 注册中心相关 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Config 配置中心相关 -->
|
<!-- Config 配置中心相关 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Job 定时任务相关 -->
|
<!-- Job 定时任务相关 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.viewsh</groupId>
|
<groupId>com.viewsh</groupId>
|
||||||
<artifactId>viewsh-spring-boot-starter-job</artifactId>
|
<artifactId>viewsh-spring-boot-starter-job</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 消息队列相关 -->
|
<!-- 消息队列相关 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.viewsh</groupId>
|
<groupId>com.viewsh</groupId>
|
||||||
<artifactId>viewsh-spring-boot-starter-mq</artifactId>
|
<artifactId>viewsh-spring-boot-starter-mq</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.rocketmq</groupId>
|
||||||
|
<artifactId>rocketmq-spring-boot-starter</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Test 测试相关 -->
|
<!-- Test 测试相关 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.viewsh</groupId>
|
<groupId>com.viewsh</groupId>
|
||||||
<artifactId>viewsh-spring-boot-starter-test</artifactId>
|
<artifactId>viewsh-spring-boot-starter-test</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 工具类相关 -->
|
<!-- 工具类相关 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.viewsh</groupId>
|
<groupId>com.viewsh</groupId>
|
||||||
<artifactId>viewsh-spring-boot-starter-excel</artifactId>
|
<artifactId>viewsh-spring-boot-starter-excel</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 监控相关 -->
|
<!-- 监控相关 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.viewsh</groupId>
|
<groupId>com.viewsh</groupId>
|
||||||
<artifactId>viewsh-spring-boot-starter-monitor</artifactId>
|
<artifactId>viewsh-spring-boot-starter-monitor</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<!-- 设置构建的 jar 包名 -->
|
<!-- 设置构建的 jar 包名 -->
|
||||||
<finalName>${project.artifactId}</finalName>
|
<finalName>${project.artifactId}</finalName>
|
||||||
<plugins>
|
<plugins>
|
||||||
<!-- 打包 -->
|
<!-- 打包 -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>repackage</goal> <!-- 将引入的 jar 打入其中 -->
|
<goal>repackage</goal> <!-- 将引入的 jar 打入其中 -->
|
||||||
</goals>
|
</goals>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.viewsh.module.ops.framework.rpc.config;
|
||||||
|
|
||||||
|
import com.viewsh.module.iot.api.device.IotDeviceControlApi;
|
||||||
|
import com.viewsh.module.system.api.notify.NotifyMessageSendApi;
|
||||||
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration(value = "opsRpcConfiguration", proxyBeanMethods = false)
|
||||||
|
@EnableFeignClients(clients = {
|
||||||
|
NotifyMessageSendApi.class,
|
||||||
|
IotDeviceControlApi.class
|
||||||
|
})
|
||||||
|
public class RpcConfiguration {
|
||||||
|
}
|
||||||
@@ -1,139 +1,154 @@
|
|||||||
--- #################### 注册中心 + 配置中心相关配置 ####################
|
--- #################### 注册中心 + 配置中心相关配置 ####################
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
server-addr: 124.221.55.225:8848 # Nacos 服务器地址
|
server-addr: 124.221.55.225:8848 # Nacos 服务器地址
|
||||||
username: nacos # Nacos 账号
|
username: nacos # Nacos 账号
|
||||||
password: 9oDxX~}e7DeP # Nacos 密码
|
password: 9oDxX~}e7DeP # Nacos 密码
|
||||||
discovery: # 【配置中心】配置项
|
discovery: # 【配置中心】配置项
|
||||||
namespace: dev # 命名空间。这里使用 dev 开发环境
|
namespace: dev # 命名空间。这里使用 dev 开发环境
|
||||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||||
metadata:
|
metadata:
|
||||||
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
||||||
server-identity: nacosAuthKey # 身份验证密钥键
|
server-identity: nacosAuthKey # 身份验证密钥键
|
||||||
server-identity-key: 8fG4s7J2kL9pQ3dR6xT1vZ0bW5nC8mE7hY2jU4qA0rS9tV6wB3fD1gH5kL8pN2 # 密钥值
|
server-identity-key: 8fG4s7J2kL9pQ3dR6xT1vZ0bW5nC8mE7hY2jU4qA0rS9tV6wB3fD1gH5kL8pN2 # 密钥值
|
||||||
token: Z1xC9vT6pM3qL7rF2sW8bH0kD5nJ4aY9eV6uG1oR3tB8mN2wQ7cK5xS0jP4hL1 # 身份验证令牌
|
token: Z1xC9vT6pM3qL7rF2sW8bH0kD5nJ4aY9eV6uG1oR3tB8mN2wQ7cK5xS0jP4hL1 # 身份验证令牌
|
||||||
config: # 【注册中心】配置项
|
config: # 【注册中心】配置项
|
||||||
namespace: dev # 命名空间。这里使用 dev 开发环境
|
namespace: dev # 命名空间。这里使用 dev 开发环境
|
||||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||||
|
|
||||||
--- #################### 数据库相关配置 ####################
|
--- #################### 数据库相关配置 ####################
|
||||||
spring:
|
spring:
|
||||||
# 数据源配置项
|
# 数据源配置项
|
||||||
autoconfigure:
|
autoconfigure:
|
||||||
# noinspection SpringBootApplicationYaml
|
# noinspection SpringBootApplicationYaml
|
||||||
exclude:
|
exclude:
|
||||||
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源
|
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源
|
||||||
datasource:
|
datasource:
|
||||||
druid: # Druid 【监控】相关的全局配置
|
druid: # Druid 【监控】相关的全局配置
|
||||||
web-stat-filter:
|
web-stat-filter:
|
||||||
enabled: true
|
enabled: true
|
||||||
stat-view-servlet:
|
stat-view-servlet:
|
||||||
enabled: true
|
enabled: true
|
||||||
allow: # 设置白名单,不填则允许所有访问
|
allow: # 设置白名单,不填则允许所有访问
|
||||||
url-pattern: /druid/*
|
url-pattern: /druid/*
|
||||||
login-username: # 控制台管理用户名和密码
|
login-username: # 控制台管理用户名和密码
|
||||||
login-password:
|
login-password:
|
||||||
filter:
|
filter:
|
||||||
stat:
|
stat:
|
||||||
enabled: true
|
enabled: true
|
||||||
log-slow-sql: true # 慢 SQL 记录
|
log-slow-sql: true # 慢 SQL 记录
|
||||||
slow-sql-millis: 100
|
slow-sql-millis: 100
|
||||||
merge-sql: true
|
merge-sql: true
|
||||||
wall:
|
wall:
|
||||||
config:
|
config:
|
||||||
multi-statement-allow: true
|
multi-statement-allow: true
|
||||||
dynamic: # 多数据源配置
|
dynamic: # 多数据源配置
|
||||||
druid: # Druid 【连接池】相关的全局配置
|
druid: # Druid 【连接池】相关的全局配置
|
||||||
initial-size: 1 # 初始连接数
|
initial-size: 1 # 初始连接数
|
||||||
min-idle: 1 # 最小连接池数量
|
min-idle: 1 # 最小连接池数量
|
||||||
max-active: 20 # 最大连接池数量
|
max-active: 20 # 最大连接池数量
|
||||||
max-wait: 60000 # 配置获取连接等待超时的时间,单位:毫秒(1 分钟)
|
max-wait: 60000 # 配置获取连接等待超时的时间,单位:毫秒(1 分钟)
|
||||||
time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒(1 分钟)
|
time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒(1 分钟)
|
||||||
min-evictable-idle-time-millis: 600000 # 配置一个连接在池中最小生存的时间,单位:毫秒(10 分钟)
|
min-evictable-idle-time-millis: 600000 # 配置一个连接在池中最小生存的时间,单位:毫秒(10 分钟)
|
||||||
max-evictable-idle-time-millis: 1800000 # 配置一个连接在池中最大生存的时间,单位:毫秒(30 分钟)
|
max-evictable-idle-time-millis: 1800000 # 配置一个连接在池中最大生存的时间,单位:毫秒(30 分钟)
|
||||||
validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效
|
validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效
|
||||||
test-while-idle: true
|
test-while-idle: true
|
||||||
test-on-borrow: false
|
test-on-borrow: false
|
||||||
test-on-return: false
|
test-on-return: false
|
||||||
pool-prepared-statements: true # 是否开启 PreparedStatement 缓存
|
pool-prepared-statements: true # 是否开启 PreparedStatement 缓存
|
||||||
max-pool-prepared-statement-per-connection-size: 20 # 每个连接缓存的 PreparedStatement 数量
|
max-pool-prepared-statement-per-connection-size: 20 # 每个连接缓存的 PreparedStatement 数量
|
||||||
primary: master
|
primary: master
|
||||||
datasource:
|
datasource:
|
||||||
master:
|
master:
|
||||||
url: jdbc:mysql://${MYSQL_HOST:124.221.55.225}:${MYSQL_PORT:3306}/${MYSQL_DATABASE:aiot-platform}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
|
url: jdbc:mysql://${MYSQL_HOST:124.221.55.225}:${MYSQL_PORT:3306}/${MYSQL_DATABASE:aiot-platform}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
|
||||||
username: ${MYSQL_USERNAME:root}
|
username: ${MYSQL_USERNAME:root}
|
||||||
password: ${MYSQL_PASSWORD:65p^VTPi9Qd+}
|
password: ${MYSQL_PASSWORD:65p^VTPi9Qd+}
|
||||||
# username: sa # SQL Server 连接的示例
|
# username: sa # SQL Server 连接的示例
|
||||||
# password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W # SQL Server 连接的示例
|
# password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W # SQL Server 连接的示例
|
||||||
# username: SYSDBA # DM 连接的示例
|
# username: SYSDBA # DM 连接的示例
|
||||||
# password: SYSDBA # DM 连接的示例
|
# password: SYSDBA # DM 连接的示例
|
||||||
slave: # 模拟从库,可根据自己需要修改
|
slave: # 模拟从库,可根据自己需要修改
|
||||||
lazy: true # 开启懒加载,保证启动速度
|
lazy: true # 开启懒加载,保证启动速度
|
||||||
url: jdbc:mysql://${MYSQL_HOST:124.221.55.225}:${MYSQL_PORT:3306}/${MYSQL_DATABASE:aiot-platform}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true
|
url: jdbc:mysql://${MYSQL_HOST:124.221.55.225}:${MYSQL_PORT:3306}/${MYSQL_DATABASE:aiot-platform}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true
|
||||||
username: ${MYSQL_USERNAME:root}
|
username: ${MYSQL_USERNAME:root}
|
||||||
password: ${MYSQL_PASSWORD:65p^VTPi9Qd+}
|
password: ${MYSQL_PASSWORD:65p^VTPi9Qd+}
|
||||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||||
data:
|
data:
|
||||||
redis:
|
redis:
|
||||||
host: 127.0.0.1 # 地址
|
host: 127.0.0.1 # 地址
|
||||||
port: 6379 # 端口
|
port: 6379 # 端口
|
||||||
database: 0 # 数据库索引
|
database: 0 # 数据库索引
|
||||||
# password: 123456 # 密码,建议生产环境开启
|
# password: 123456 # 密码,建议生产环境开启
|
||||||
|
|
||||||
--- #################### MQ 消息队列相关配置 ####################
|
--- #################### MQ 消息队列相关配置 ####################
|
||||||
|
|
||||||
--- #################### 定时任务相关配置 ####################
|
# rocketmq 配置项,对应 RocketMQProperties 配置类
|
||||||
|
rocketmq:
|
||||||
xxl:
|
name-server: 124.221.55.225:9876 # RocketMQ Namesrv
|
||||||
job:
|
|
||||||
enabled: false # 暂时禁用 xxl-job
|
spring:
|
||||||
admin:
|
# RabbitMQ 配置项,对应 RabbitProperties 配置类
|
||||||
addresses: http://127.0.0.1:9090/xxl-job-admin # 调度中心部署跟地址
|
rabbitmq:
|
||||||
|
host: 127.0.0.1 # RabbitMQ 服务的地址
|
||||||
--- #################### 服务保障相关配置 ####################
|
port: 5672 # RabbitMQ 服务的端口
|
||||||
|
username: guest # RabbitMQ 服务的账号
|
||||||
# Lock4j 配置项
|
password: guest # RabbitMQ 服务的密码
|
||||||
lock4j:
|
# Kafka 配置项,对应 KafkaProperties 配置类
|
||||||
acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒
|
kafka:
|
||||||
expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒
|
bootstrap-servers: 127.0.0.1:9092 # 指定 Kafka Broker 地址,可以设置多个,以逗号分隔
|
||||||
|
|
||||||
--- #################### 监控相关配置 ####################
|
--- #################### 定时任务相关配置 ####################
|
||||||
|
|
||||||
# Actuator 监控端点的配置项
|
xxl:
|
||||||
management:
|
job:
|
||||||
endpoints:
|
enabled: false # 暂时禁用 xxl-job
|
||||||
web:
|
admin:
|
||||||
base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator
|
addresses: http://127.0.0.1:9090/xxl-job-admin # 调度中心部署跟地址
|
||||||
exposure:
|
|
||||||
include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
|
--- #################### 服务保障相关配置 ####################
|
||||||
|
|
||||||
# Spring Boot Admin 配置项
|
# Lock4j 配置项
|
||||||
spring:
|
lock4j:
|
||||||
boot:
|
acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒
|
||||||
admin:
|
expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒
|
||||||
# Spring Boot Admin Client 客户端的相关配置
|
|
||||||
client:
|
--- #################### 监控相关配置 ####################
|
||||||
instance:
|
|
||||||
service-host-type: IP # 注册实例时,优先使用 IP [IP, HOST_NAME, CANONICAL_HOST_NAME]
|
# Actuator 监控端点的配置项
|
||||||
username: admin
|
management:
|
||||||
password: admin
|
endpoints:
|
||||||
|
web:
|
||||||
# 日志文件配置
|
base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator
|
||||||
logging:
|
exposure:
|
||||||
level:
|
include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
|
||||||
# 配置自己写的 MyBatis Mapper 打印日志
|
|
||||||
com.viewsh.module.ops.dal.mysql: debug
|
# Spring Boot Admin 配置项
|
||||||
org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # TODO 芋艿:先禁用,Spring Boot 3.X 存在部分错误的 WARN 提示
|
spring:
|
||||||
|
boot:
|
||||||
--- #################### 芋道相关配置 ####################
|
admin:
|
||||||
|
# Spring Boot Admin Client 客户端的相关配置
|
||||||
# 芋道配置项,设置当前项目所有自定义的配置
|
client:
|
||||||
viewsh:
|
instance:
|
||||||
env: # 多环境的配置项
|
service-host-type: IP # 注册实例时,优先使用 IP [IP, HOST_NAME, CANONICAL_HOST_NAME]
|
||||||
tag: ${HOSTNAME}
|
username: admin
|
||||||
security:
|
password: admin
|
||||||
mock-enable: true
|
|
||||||
access-log: # 访问日志的配置项
|
# 日志文件配置
|
||||||
enable: false
|
logging:
|
||||||
|
level:
|
||||||
|
# 配置自己写的 MyBatis Mapper 打印日志
|
||||||
|
com.viewsh.module.ops.dal.mysql: debug
|
||||||
|
org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # TODO 芋艿:先禁用,Spring Boot 3.X 存在部分错误的 WARN 提示
|
||||||
|
|
||||||
|
--- #################### 芋道相关配置 ####################
|
||||||
|
|
||||||
|
# 芋道配置项,设置当前项目所有自定义的配置
|
||||||
|
viewsh:
|
||||||
|
env: # 多环境的配置项
|
||||||
|
tag: ${HOSTNAME}
|
||||||
|
security:
|
||||||
|
mock-enable: true
|
||||||
|
access-log: # 访问日志的配置项
|
||||||
|
enable: false
|
||||||
|
|||||||
@@ -1,119 +1,143 @@
|
|||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: ops-server
|
name: ops-server
|
||||||
|
|
||||||
profiles:
|
profiles:
|
||||||
active: local
|
active: local
|
||||||
|
|
||||||
main:
|
main:
|
||||||
allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。
|
allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。
|
||||||
allow-bean-definition-overriding: true # 允许 Bean 覆盖,例如说 Feign 等会存在重复定义的服务
|
allow-bean-definition-overriding: true # 允许 Bean 覆盖,例如说 Feign 等会存在重复定义的服务
|
||||||
|
|
||||||
config:
|
config:
|
||||||
import:
|
import:
|
||||||
- optional:classpath:application-${spring.profiles.active}.yaml # 加载【本地】配置
|
- optional:classpath:application-${spring.profiles.active}.yaml # 加载【本地】配置
|
||||||
- optional:nacos:${spring.application.name}-${spring.profiles.active}.yaml # 加载【Nacos】的配置
|
- optional:nacos:${spring.application.name}-${spring.profiles.active}.yaml # 加载【Nacos】的配置
|
||||||
|
|
||||||
# Servlet 配置
|
# Servlet 配置
|
||||||
servlet:
|
servlet:
|
||||||
# 文件上传相关配置项
|
# 文件上传相关配置项
|
||||||
multipart:
|
multipart:
|
||||||
max-file-size: 16MB # 单个文件大小
|
max-file-size: 16MB # 单个文件大小
|
||||||
max-request-size: 32MB # 设置总上传的文件大小
|
max-request-size: 32MB # 设置总上传的文件大小
|
||||||
|
|
||||||
# Jackson 配置项
|
# Jackson 配置项
|
||||||
jackson:
|
jackson:
|
||||||
serialization:
|
serialization:
|
||||||
write-dates-as-timestamps: true # 设置 LocalDateTime 的格式,使用时间戳
|
write-dates-as-timestamps: true # 设置 LocalDateTime 的格式,使用时间戳
|
||||||
write-date-timestamps-as-nanoseconds: false # 设置不使用 nanoseconds 的格式。例如说 1611460870.401,而是直接 1611460870401
|
write-date-timestamps-as-nanoseconds: false # 设置不使用 nanoseconds 的格式。例如说 1611460870.401,而是直接 1611460870401
|
||||||
write-durations-as-timestamps: true # 设置 Duration 的格式,使用时间戳
|
write-durations-as-timestamps: true # 设置 Duration 的格式,使用时间戳
|
||||||
fail-on-empty-beans: false # 允许序列化无属性的 Bean
|
fail-on-empty-beans: false # 允许序列化无属性的 Bean
|
||||||
|
|
||||||
# Cache 配置项
|
# Cache 配置项
|
||||||
cache:
|
cache:
|
||||||
type: REDIS
|
type: REDIS
|
||||||
redis:
|
redis:
|
||||||
time-to-live: 1h # 设置过期时间为 1 小时
|
time-to-live: 1h # 设置过期时间为 1 小时
|
||||||
|
|
||||||
server:
|
server:
|
||||||
port: 48092
|
port: 48092
|
||||||
|
|
||||||
logging:
|
logging:
|
||||||
file:
|
file:
|
||||||
name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径
|
name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径
|
||||||
|
|
||||||
--- #################### 接口文档配置 ####################
|
--- #################### 接口文档配置 ####################
|
||||||
|
|
||||||
springdoc:
|
springdoc:
|
||||||
api-docs:
|
api-docs:
|
||||||
enabled: true # 1. 是否开启 Swagger 接文档的元数据
|
enabled: true # 1. 是否开启 Swagger 接文档的元数据
|
||||||
path: /v3/api-docs
|
path: /v3/api-docs
|
||||||
swagger-ui:
|
swagger-ui:
|
||||||
enabled: true # 2.1 是否开启 Swagger 文档的官方 UI 界面
|
enabled: true # 2.1 是否开启 Swagger 文档的官方 UI 界面
|
||||||
path: /swagger-ui.html
|
path: /swagger-ui.html
|
||||||
default-flat-param-object: true # 参见 https://doc.xiaominfo.com/docs/faq/v4/knife4j-parameterobject-flat-param 文档
|
default-flat-param-object: true # 参见 https://doc.xiaominfo.com/docs/faq/v4/knife4j-parameterobject-flat-param 文档
|
||||||
|
|
||||||
knife4j:
|
knife4j:
|
||||||
enable: true # 2.2 是否开启 Swagger 文档的 Knife4j UI 界面
|
enable: true # 2.2 是否开启 Swagger 文档的 Knife4j UI 界面
|
||||||
setting:
|
setting:
|
||||||
language: zh_cn
|
language: zh_cn
|
||||||
|
|
||||||
# MyBatis Plus 的配置项
|
# MyBatis Plus 的配置项
|
||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
configuration:
|
configuration:
|
||||||
map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
|
map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
|
||||||
global-config:
|
global-config:
|
||||||
db-config:
|
db-config:
|
||||||
id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
|
id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
|
||||||
# id-type: AUTO # 自增 ID,适合 MySQL 等直接自增的数据库
|
# id-type: AUTO # 自增 ID,适合 MySQL 等直接自增的数据库
|
||||||
# id-type: INPUT # 用户输入 ID,适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库
|
# id-type: INPUT # 用户输入 ID,适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库
|
||||||
# id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解
|
# id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解
|
||||||
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
|
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
|
||||||
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
|
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
|
||||||
banner: false # 关闭控制台的 Banner 打印
|
banner: false # 关闭控制台的 Banner 打印
|
||||||
type-aliases-package: ${viewsh.info.base-package}.module.*.dal.dataobject
|
type-aliases-package: ${viewsh.info.base-package}.module.*.dal.dataobject
|
||||||
encryptor:
|
encryptor:
|
||||||
password: XDV71a+xqStEA3WH # 加解密的秘钥,可使用 https://www.imaegoo.com/2020/aes-key-generator/ 网站生成
|
password: XDV71a+xqStEA3WH # 加解密的秘钥,可使用 https://www.imaegoo.com/2020/aes-key-generator/ 网站生成
|
||||||
|
|
||||||
mybatis-plus-join:
|
mybatis-plus-join:
|
||||||
banner: false # 关闭控制台的 Banner 打印
|
banner: false # 关闭控制台的 Banner 打印
|
||||||
|
|
||||||
# VO 转换(数据翻译)相关
|
# VO 转换(数据翻译)相关
|
||||||
easy-trans:
|
easy-trans:
|
||||||
is-enable-global: false # 【默认禁用,对性能确认压力大】启用全局翻译(拦截所有 SpringMVC ResponseBody 进行自动翻译 )。如果对于性能要求很高可关闭此配置,或通过 @IgnoreTrans 忽略某个接口
|
is-enable-global: false # 【默认禁用,对性能确认压力大】启用全局翻译(拦截所有 SpringMVC ResponseBody 进行自动翻译 )。如果对于性能要求很高可关闭此配置,或通过 @IgnoreTrans 忽略某个接口
|
||||||
|
|
||||||
--- #################### RPC 远程调用相关配置 ####################
|
--- #################### RPC 远程调用相关配置 ####################
|
||||||
|
|
||||||
--- #################### MQ 消息队列相关配置 ####################
|
--- #################### 消息队列相关 ####################
|
||||||
|
|
||||||
--- #################### 定时任务相关配置 ####################
|
# rocketmq 配置项,对应 RocketMQProperties 配置类
|
||||||
|
rocketmq:
|
||||||
xxl:
|
# Producer 配置项
|
||||||
job:
|
producer:
|
||||||
executor:
|
group: ${spring.application.name}_PRODUCER # 生产者分组
|
||||||
appname: ${spring.application.name} # 执行器 AppName
|
|
||||||
logpath: ${user.home}/logs/xxl-job/${spring.application.name} # 执行器运行日志文件存储磁盘路径
|
spring:
|
||||||
accessToken: default_token # 执行器通讯TOKEN
|
# Kafka 配置项,对应 KafkaProperties 配置类
|
||||||
|
kafka:
|
||||||
--- #################### 芋道相关配置 ####################
|
# Kafka Producer 配置项
|
||||||
|
producer:
|
||||||
viewsh:
|
acks: 1 # 0-不应答。1-leader 应答。all-所有 leader 和 follower 应答。
|
||||||
info:
|
retries: 3 # 发送失败时,重试发送的次数
|
||||||
version: 1.0.0
|
value-serializer: org.springframework.kafka.support.serializer.JsonSerializer # 消息的 value 的序列化
|
||||||
base-package: com.viewsh.module.ops
|
# Kafka Consumer 配置项
|
||||||
web:
|
consumer:
|
||||||
admin-ui:
|
auto-offset-reset: earliest # 设置消费者分组最初的消费进度为 earliest 。可参考博客 https://blog.csdn.net/lishuangzhe7047/article/details/74530417 理解
|
||||||
url: http://dashboard.viewsh.iocoder.cn # Admin 管理后台 UI 的地址
|
value-deserializer: org.springframework.kafka.support.serializer.JsonDeserializer
|
||||||
xss:
|
properties:
|
||||||
enable: false
|
spring.json.trusted.packages: '*'
|
||||||
exclude-urls: # 如下两个 url,仅仅是为了演示,去掉配置也没关系
|
# Kafka Consumer Listener 监听器配置
|
||||||
- ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求
|
listener:
|
||||||
- ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求
|
missing-topics-fatal: false # 消费监听接口监听的主题不存在时,默认会报错。所以通过设置为 false ,解决报错
|
||||||
swagger:
|
|
||||||
title: 管理后台
|
--- #################### 定时任务相关配置 ####################
|
||||||
description: 提供管理员管理的所有功能
|
|
||||||
version: ${viewsh.info.version}
|
xxl:
|
||||||
tenant: # 多租户相关配置项
|
job:
|
||||||
enable: true
|
executor:
|
||||||
|
appname: ${spring.application.name} # 执行器 AppName
|
||||||
debug: false
|
logpath: ${user.home}/logs/xxl-job/${spring.application.name} # 执行器运行日志文件存储磁盘路径
|
||||||
|
accessToken: default_token # 执行器通讯TOKEN
|
||||||
|
|
||||||
|
--- #################### 芋道相关配置 ####################
|
||||||
|
|
||||||
|
viewsh:
|
||||||
|
info:
|
||||||
|
version: 1.0.0
|
||||||
|
base-package: com.viewsh.module.ops
|
||||||
|
web:
|
||||||
|
admin-ui:
|
||||||
|
url: http://dashboard.viewsh.iocoder.cn # Admin 管理后台 UI 的地址
|
||||||
|
xss:
|
||||||
|
enable: false
|
||||||
|
exclude-urls: # 如下两个 url,仅仅是为了演示,去掉配置也没关系
|
||||||
|
- ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求
|
||||||
|
- ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求
|
||||||
|
swagger:
|
||||||
|
title: 管理后台
|
||||||
|
description: 提供管理员管理的所有功能
|
||||||
|
version: ${viewsh.info.version}
|
||||||
|
tenant: # 多租户相关配置项
|
||||||
|
enable: true
|
||||||
|
|
||||||
|
debug: false
|
||||||
|
|||||||
Reference in New Issue
Block a user