Pre Merge pull request !31 from 丨H丨/master
This commit is contained in:
commit
94c139059c
513
pom.xml
513
pom.xml
|
|
@ -1,238 +1,277 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi</artifactId>
|
<artifactId>ruoyi</artifactId>
|
||||||
<version>2.3.0</version>
|
<version>2.3.0</version>
|
||||||
|
|
||||||
<name>ruoyi</name>
|
<name>ruoyi</name>
|
||||||
<url>http://www.ruoyi.vip</url>
|
<url>http://www.ruoyi.vip</url>
|
||||||
<description>若依微服务系统</description>
|
<description>若依微服务系统</description>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<ruoyi.version>2.3.0</ruoyi.version>
|
<ruoyi.version>2.3.0</ruoyi.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<spring-boot.version>2.3.4.RELEASE</spring-boot.version>
|
<spring-boot.version>2.3.4.RELEASE</spring-boot.version>
|
||||||
<spring-cloud.version>Hoxton.SR8</spring-cloud.version>
|
<spring-cloud.version>Hoxton.SR8</spring-cloud.version>
|
||||||
<spring-cloud-alibaba.version>2.2.3.RELEASE</spring-cloud-alibaba.version>
|
<spring-cloud-alibaba.version>2.2.3.RELEASE</spring-cloud-alibaba.version>
|
||||||
<spring-boot-admin.version>2.3.0</spring-boot-admin.version>
|
<spring-boot-admin.version>2.3.0</spring-boot-admin.version>
|
||||||
<spring-boot.mybatis>2.1.3</spring-boot.mybatis>
|
<spring-boot.mybatis>2.1.3</spring-boot.mybatis>
|
||||||
<swagger.fox.version>2.9.2</swagger.fox.version>
|
<swagger.fox.version>2.9.2</swagger.fox.version>
|
||||||
<swagger.core.version>1.5.24</swagger.core.version>
|
<swagger.core.version>1.5.24</swagger.core.version>
|
||||||
<tobato.version>1.26.5</tobato.version>
|
<tobato.version>1.26.5</tobato.version>
|
||||||
<kaptcha.version>2.3.2</kaptcha.version>
|
<kaptcha.version>2.3.2</kaptcha.version>
|
||||||
<pagehelper.boot.version>1.3.0</pagehelper.boot.version>
|
<pagehelper.boot.version>1.3.0</pagehelper.boot.version>
|
||||||
<commons.io.version>2.5</commons.io.version>
|
<commons.io.version>2.5</commons.io.version>
|
||||||
<commons.fileupload.version>1.3.3</commons.fileupload.version>
|
<commons.fileupload.version>1.3.3</commons.fileupload.version>
|
||||||
<velocity.version>1.7</velocity.version>
|
<velocity.version>1.7</velocity.version>
|
||||||
<fastjson.version>1.2.74</fastjson.version>
|
<fastjson.version>1.2.74</fastjson.version>
|
||||||
<poi.version>4.1.2</poi.version>
|
<poi.version>4.1.2</poi.version>
|
||||||
<common-pool.version>2.6.2</common-pool.version>
|
<common-pool.version>2.6.2</common-pool.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<!-- 依赖声明 -->
|
<!-- 依赖声明 -->
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<!-- SpringCloud 微服务 -->
|
<!-- SpringCloud 微服务 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-dependencies</artifactId>
|
<artifactId>spring-cloud-dependencies</artifactId>
|
||||||
<version>${spring-cloud.version}</version>
|
<version>${spring-cloud.version}</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- SpringCloud Alibaba 微服务 -->
|
<!-- SpringCloud Alibaba 微服务 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
||||||
<version>${spring-cloud-alibaba.version}</version>
|
<version>${spring-cloud-alibaba.version}</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- SpringBoot 依赖配置 -->
|
<!-- SpringBoot 依赖配置 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-dependencies</artifactId>
|
<artifactId>spring-boot-dependencies</artifactId>
|
||||||
<version>${spring-boot.version}</version>
|
<version>${spring-boot.version}</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- SpringBoot 监控客户端 -->
|
<!-- SpringBoot 监控客户端 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>de.codecentric</groupId>
|
<groupId>de.codecentric</groupId>
|
||||||
<artifactId>spring-boot-admin-starter-client</artifactId>
|
<artifactId>spring-boot-admin-starter-client</artifactId>
|
||||||
<version>${spring-boot-admin.version}</version>
|
<version>${spring-boot-admin.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- FastDFS 分布式文件系统 -->
|
<!-- FastDFS 分布式文件系统 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.tobato</groupId>
|
<groupId>com.github.tobato</groupId>
|
||||||
<artifactId>fastdfs-client</artifactId>
|
<artifactId>fastdfs-client</artifactId>
|
||||||
<version>${tobato.version}</version>
|
<version>${tobato.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 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>${spring-boot.mybatis}</version>
|
<version>${spring-boot.mybatis}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Swagger 依赖配置 -->
|
<!-- Swagger 依赖配置 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.swagger</groupId>
|
<groupId>io.swagger</groupId>
|
||||||
<artifactId>swagger-models</artifactId>
|
<artifactId>swagger-models</artifactId>
|
||||||
<version>${swagger.core.version}</version>
|
<version>${swagger.core.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.swagger</groupId>
|
<groupId>io.swagger</groupId>
|
||||||
<artifactId>swagger-annotations</artifactId>
|
<artifactId>swagger-annotations</artifactId>
|
||||||
<version>${swagger.core.version}</version>
|
<version>${swagger.core.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 验证码 -->
|
<!-- 验证码 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.penggle</groupId>
|
<groupId>com.github.penggle</groupId>
|
||||||
<artifactId>kaptcha</artifactId>
|
<artifactId>kaptcha</artifactId>
|
||||||
<version>${kaptcha.version}</version>
|
<version>${kaptcha.version}</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.boot.version}</version>
|
<version>${pagehelper.boot.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- io常用工具类 -->
|
<!-- io常用工具类 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-io</groupId>
|
<groupId>commons-io</groupId>
|
||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
<version>${commons.io.version}</version>
|
<version>${commons.io.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- excel工具 -->
|
<!-- excel工具 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.poi</groupId>
|
<groupId>org.apache.poi</groupId>
|
||||||
<artifactId>poi-ooxml</artifactId>
|
<artifactId>poi-ooxml</artifactId>
|
||||||
<version>${poi.version}</version>
|
<version>${poi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 文件上传工具类 -->
|
<!-- 文件上传工具类 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-fileupload</groupId>
|
<groupId>commons-fileupload</groupId>
|
||||||
<artifactId>commons-fileupload</artifactId>
|
<artifactId>commons-fileupload</artifactId>
|
||||||
<version>${commons.fileupload.version}</version>
|
<version>${commons.fileupload.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 代码生成使用模板 -->
|
<!-- 代码生成使用模板 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.velocity</groupId>
|
<groupId>org.apache.velocity</groupId>
|
||||||
<artifactId>velocity</artifactId>
|
<artifactId>velocity</artifactId>
|
||||||
<version>${velocity.version}</version>
|
<version>${velocity.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- JSON 解析器和生成器 -->
|
<!-- JSON 解析器和生成器 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>fastjson</artifactId>
|
<artifactId>fastjson</artifactId>
|
||||||
<version>${fastjson.version}</version>
|
<version>${fastjson.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 公共资源池 -->
|
<!-- 公共资源池 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
<artifactId>commons-pool2</artifactId>
|
<artifactId>commons-pool2</artifactId>
|
||||||
<version>${common-pool.version}</version>
|
<version>${common-pool.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 核心模块 -->
|
<!-- 核心模块 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common-core</artifactId>
|
<artifactId>ruoyi-common-core</artifactId>
|
||||||
<version>${ruoyi.version}</version>
|
<version>${ruoyi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 接口模块 -->
|
<!-- 接口模块 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common-swagger</artifactId>
|
<artifactId>ruoyi-common-swagger</artifactId>
|
||||||
<version>${ruoyi.version}</version>
|
<version>${ruoyi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 安全模块 -->
|
<!-- 安全模块 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common-security</artifactId>
|
<artifactId>ruoyi-common-security</artifactId>
|
||||||
<version>${ruoyi.version}</version>
|
<version>${ruoyi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 权限范围 -->
|
<!-- 权限范围 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common-datascope</artifactId>
|
<artifactId>ruoyi-common-datascope</artifactId>
|
||||||
<version>${ruoyi.version}</version>
|
<version>${ruoyi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 日志记录 -->
|
<!-- 日志记录 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common-log</artifactId>
|
<artifactId>ruoyi-common-log</artifactId>
|
||||||
<version>${ruoyi.version}</version>
|
<version>${ruoyi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 缓存服务 -->
|
<!-- 缓存服务 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common-redis</artifactId>
|
<artifactId>ruoyi-common-redis</artifactId>
|
||||||
<version>${ruoyi.version}</version>
|
<version>${ruoyi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 系统接口 -->
|
<!-- 系统接口 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-api-system</artifactId>
|
<artifactId>ruoyi-api-system</artifactId>
|
||||||
<version>${ruoyi.version}</version>
|
<version>${ruoyi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>ruoyi-auth</module>
|
<module>ruoyi-auth</module>
|
||||||
<module>ruoyi-gateway</module>
|
<module>ruoyi-gateway</module>
|
||||||
<module>ruoyi-visual</module>
|
<module>ruoyi-visual</module>
|
||||||
<module>ruoyi-modules</module>
|
<module>ruoyi-modules</module>
|
||||||
<module>ruoyi-api</module>
|
<module>ruoyi-api</module>
|
||||||
<module>ruoyi-common</module>
|
<module>ruoyi-common</module>
|
||||||
</modules>
|
</modules>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>${java.version}</source>
|
<source>${java.version}</source>
|
||||||
<target>${java.version}</target>
|
<target>${java.version}</target>
|
||||||
<encoding>${project.build.sourceEncoding}</encoding>
|
<encoding>${project.build.sourceEncoding}</encoding>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
|
||||||
|
<resources>
|
||||||
|
<!--多环境参数切换必要配置-->
|
||||||
|
<resource>
|
||||||
|
<directory>${project.basedir}/src/main/resources</directory>
|
||||||
|
<includes>
|
||||||
|
<include>bootstrap.yml</include>
|
||||||
|
<include>**/*.xml</include>
|
||||||
|
</includes>
|
||||||
|
<!--编译后的文件中${}引用的参数,是否转换为对应数值-->
|
||||||
|
<filtering>true</filtering>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<!-- 环境配置 -->
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>dev</id>
|
||||||
|
<properties>
|
||||||
|
<profile.active>dev</profile.active>
|
||||||
|
<discovery.server-addr>127.0.0.1:8848</discovery.server-addr>
|
||||||
|
<config.server-addr>127.0.0.1:8848</config.server-addr>
|
||||||
|
<config.namespaceId>5c8aa4bc-b36e-490a-9f5f-1c13d310caf5</config.namespaceId>
|
||||||
|
</properties>
|
||||||
|
<activation>
|
||||||
|
<activeByDefault>true</activeByDefault>
|
||||||
|
</activation>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>pro</id>
|
||||||
|
<properties>
|
||||||
|
<profile.active>pro</profile.active>
|
||||||
|
<discovery.server-addr>127.0.0.1:8848</discovery.server-addr>
|
||||||
|
<config.server-addr>127.0.0.1:8848</config.server-addr>
|
||||||
|
<config.namespaceId>5c8aa4bc-b36e-490a-9f5f-1c13d310caf5</config.namespaceId>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package com.ruoyi.auth;
|
package com.ruoyi.auth;
|
||||||
|
|
||||||
|
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.cloud.client.SpringCloudApplication;
|
import org.springframework.cloud.client.SpringCloudApplication;
|
||||||
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 认证授权中心
|
* 认证授权中心
|
||||||
|
|
@ -11,6 +12,7 @@ import com.ruoyi.common.security.annotation.EnableRyFeignClients;
|
||||||
*/
|
*/
|
||||||
@EnableRyFeignClients
|
@EnableRyFeignClients
|
||||||
@SpringCloudApplication
|
@SpringCloudApplication
|
||||||
|
@ComponentScan(basePackages ="com.ruoyi")
|
||||||
public class RuoYiAuthApplication
|
public class RuoYiAuthApplication
|
||||||
{
|
{
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
|
|
|
||||||
|
|
@ -9,15 +9,25 @@ spring:
|
||||||
name: ruoyi-auth
|
name: ruoyi-auth
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: @profile.active@
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
|
# 注册中心
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: @discovery.server-addr@
|
||||||
|
# 配置命名空间
|
||||||
|
namespace: @config.namespaceId@
|
||||||
|
# 配置groupID
|
||||||
|
group: ${spring.profiles.active}
|
||||||
|
# 配置中心
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: @config.server-addr@
|
||||||
|
# 配置命名空间
|
||||||
|
namespace: @config.namespaceId@
|
||||||
|
# 配置groupID
|
||||||
|
group: ${spring.profiles.active}
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,71 @@
|
||||||
|
package com.ruoyi.common.log.service;
|
||||||
|
|
||||||
|
import com.ruoyi.common.log.utils.SystemInfoPrinter;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统启动服务,用于检查系统状态及打印系统信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
@Component
|
||||||
|
class SystemInistService {
|
||||||
|
private SystemInistService systemInistService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment environment;
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
private void inist() {
|
||||||
|
systemInistService = this;
|
||||||
|
|
||||||
|
try {
|
||||||
|
SystemInfoPrinter.printInfo("dts 初始化信息", getSystemInfo());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<String, String> getSystemInfo() {
|
||||||
|
|
||||||
|
Map<String, String> infos = new LinkedHashMap<>();
|
||||||
|
|
||||||
|
infos.put(SystemInfoPrinter.CREATE_PART_COPPER + 0, "系统信息");
|
||||||
|
// 测试获取application-db.yml配置信息
|
||||||
|
infos.put("服务器端口", environment.getProperty("server.port"));
|
||||||
|
infos.put("数据库USER", environment.getProperty("spring.datasource.druid.username"));
|
||||||
|
infos.put("数据库地址", environment.getProperty("spring.datasource.druid.url"));
|
||||||
|
infos.put("调试级别", environment.getProperty("logging.level.com.qiguliuxing.dts.wx"));
|
||||||
|
|
||||||
|
// 测试获取application-core.yml配置信息
|
||||||
|
infos.put(SystemInfoPrinter.CREATE_PART_COPPER + 1, "模块状态");
|
||||||
|
infos.put("邮件", environment.getProperty("dts.notify.mail.enable"));
|
||||||
|
infos.put("短信", environment.getProperty("dts.notify.sms.enable"));
|
||||||
|
infos.put("模版消息", environment.getProperty("dts.notify.wx.enable"));
|
||||||
|
infos.put("快递信息", environment.getProperty("dts.express.enable"));
|
||||||
|
infos.put("快递鸟ID", environment.getProperty("dts.express.appId"));
|
||||||
|
infos.put("对象存储", environment.getProperty("dts.storage.active"));
|
||||||
|
infos.put("本地对象存储路径", environment.getProperty("dts.storage.local.storagePath"));
|
||||||
|
infos.put("本地对象访问地址", environment.getProperty("dts.storage.local.address"));
|
||||||
|
infos.put("本地对象访问端口", environment.getProperty("dts.storage.local.port"));
|
||||||
|
|
||||||
|
// 微信相关信息,屏蔽打印控制台
|
||||||
|
infos.put(SystemInfoPrinter.CREATE_PART_COPPER + 2, "微信相关");
|
||||||
|
infos.put("微信APP KEY", environment.getProperty("dts.wx.app-id"));
|
||||||
|
infos.put("微信APP-SECRET", environment.getProperty("dts.wx.app-secret"));
|
||||||
|
infos.put("微信支付MCH-ID", environment.getProperty("dts.wx.mch-id"));
|
||||||
|
infos.put("微信支付MCH-KEY", environment.getProperty("dts.wx.mch-key"));
|
||||||
|
infos.put("微信支付通知地址", environment.getProperty("dts.wx.notify-url"));
|
||||||
|
|
||||||
|
// 测试获取System表配置信息
|
||||||
|
infos.put(SystemInfoPrinter.CREATE_PART_COPPER + 3, "系统设置");
|
||||||
|
|
||||||
|
return infos;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
package com.ruoyi.common.log.utils;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class SystemInfoPrinter {
|
||||||
|
public static final String CREATE_PART_COPPER = "XOXOXOXOX";
|
||||||
|
|
||||||
|
private static int maxSize = 0;
|
||||||
|
|
||||||
|
public static void printInfo(String title, Map<String, String> infos) {
|
||||||
|
setMaxSize(infos);
|
||||||
|
|
||||||
|
printHeader(title);
|
||||||
|
|
||||||
|
for (Map.Entry<String, String> entry : infos.entrySet()) {
|
||||||
|
printLine(entry.getKey(), entry.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
printEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setMaxSize(Map<String, String> infos) {
|
||||||
|
for (Map.Entry<String, String> entry : infos.entrySet()) {
|
||||||
|
if (entry.getValue() == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int size = entry.getKey().length() + entry.getValue().length();
|
||||||
|
|
||||||
|
if (size > maxSize) {
|
||||||
|
maxSize = size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
maxSize = maxSize + 30;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void printHeader(String title) {
|
||||||
|
System.out.println(getLineCopper());
|
||||||
|
System.out.println("");
|
||||||
|
System.out.println(" " + title);
|
||||||
|
System.out.println("");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void printEnd() {
|
||||||
|
System.out.println(" ");
|
||||||
|
System.out.println(getLineCopper());
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String getLineCopper() {
|
||||||
|
String copper = "";
|
||||||
|
for (int i = 0; i < maxSize; i++) {
|
||||||
|
copper += "=";
|
||||||
|
}
|
||||||
|
|
||||||
|
return copper;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void printLine(String head, String line) {
|
||||||
|
if (line == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (head.startsWith(CREATE_PART_COPPER)) {
|
||||||
|
System.out.println("");
|
||||||
|
System.out.println(" [[ " + line + " ]]");
|
||||||
|
System.out.println("");
|
||||||
|
} else {
|
||||||
|
System.out.println(" " + head + " -> " + line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -11,7 +11,7 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@EnableDiscoveryClient
|
@EnableDiscoveryClient
|
||||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
|
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class }, scanBasePackages = {"com.ruoyi"})
|
||||||
public class RuoYiGatewayApplication
|
public class RuoYiGatewayApplication
|
||||||
{
|
{
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
|
|
|
||||||
|
|
@ -9,17 +9,27 @@ spring:
|
||||||
name: ruoyi-gateway
|
name: ruoyi-gateway
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: @profile.active@
|
||||||
main:
|
main:
|
||||||
allow-bean-definition-overriding: true
|
allow-bean-definition-overriding: true
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
|
# 注册中心
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: @discovery.server-addr@
|
||||||
|
# 配置命名空间
|
||||||
|
namespace: @config.namespaceId@
|
||||||
|
# 配置groupID
|
||||||
|
group: ${spring.profiles.active}
|
||||||
|
# 配置中心
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: @config.server-addr@
|
||||||
|
# 配置命名空间
|
||||||
|
namespace: @config.namespaceId@
|
||||||
|
# 配置groupID
|
||||||
|
group: ${spring.profiles.active}
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
@ -34,8 +44,8 @@ spring:
|
||||||
datasource:
|
datasource:
|
||||||
ds1:
|
ds1:
|
||||||
nacos:
|
nacos:
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: @config.server-addr@
|
||||||
dataId: sentinel-ruoyi-gateway
|
dataId: sentinel-ruoyi-gateway
|
||||||
groupId: DEFAULT_GROUP
|
groupId: ${spring.profiles.active}
|
||||||
data-type: json
|
data-type: json
|
||||||
rule-type: flow
|
rule-type: flow
|
||||||
|
|
|
||||||
|
|
@ -9,15 +9,25 @@ spring:
|
||||||
name: ruoyi-file
|
name: ruoyi-file
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: @profile.active@
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
|
# 注册中心
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: @discovery.server-addr@
|
||||||
|
# 配置命名空间
|
||||||
|
namespace: @config.namespaceId@
|
||||||
|
# 配置groupID
|
||||||
|
group: ${spring.profiles.active}
|
||||||
|
# 配置中心
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: @config.server-addr@
|
||||||
|
# 配置命名空间
|
||||||
|
namespace: @config.namespaceId@
|
||||||
|
# 配置groupID
|
||||||
|
group: ${spring.profiles.active}
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
||||||
|
|
@ -9,15 +9,25 @@ spring:
|
||||||
name: ruoyi-gen
|
name: ruoyi-gen
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: @profile.active@
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
|
# 注册中心
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: @discovery.server-addr@
|
||||||
|
# 配置命名空间
|
||||||
|
namespace: @config.namespaceId@
|
||||||
|
# 配置groupID
|
||||||
|
group: ${spring.profiles.active}
|
||||||
|
# 配置中心
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: @config.server-addr@
|
||||||
|
# 配置命名空间
|
||||||
|
namespace: @config.namespaceId@
|
||||||
|
# 配置groupID
|
||||||
|
group: ${spring.profiles.active}
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
||||||
|
|
@ -9,15 +9,25 @@ spring:
|
||||||
name: ruoyi-job
|
name: ruoyi-job
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: @profile.active@
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
|
# 注册中心
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: @discovery.server-addr@
|
||||||
|
# 配置命名空间
|
||||||
|
namespace: @config.namespaceId@
|
||||||
|
# 配置groupID
|
||||||
|
group: ${spring.profiles.active}
|
||||||
|
# 配置中心
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: @config.server-addr@
|
||||||
|
# 配置命名空间
|
||||||
|
namespace: @config.namespaceId@
|
||||||
|
# 配置groupID
|
||||||
|
group: ${spring.profiles.active}
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
package com.ruoyi.system;
|
package com.ruoyi.system;
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
|
||||||
import org.springframework.cloud.client.SpringCloudApplication;
|
|
||||||
import com.ruoyi.common.security.annotation.EnableCustomConfig;
|
import com.ruoyi.common.security.annotation.EnableCustomConfig;
|
||||||
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
|
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
|
||||||
import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
|
import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.cloud.client.SpringCloudApplication;
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统模块
|
* 系统模块
|
||||||
|
|
@ -15,6 +16,7 @@ import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
|
||||||
@EnableCustomSwagger2
|
@EnableCustomSwagger2
|
||||||
@EnableRyFeignClients
|
@EnableRyFeignClients
|
||||||
@SpringCloudApplication
|
@SpringCloudApplication
|
||||||
|
@ComponentScan(basePackages ="com.ruoyi")
|
||||||
public class RuoYiSystemApplication
|
public class RuoYiSystemApplication
|
||||||
{
|
{
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
|
|
|
||||||
|
|
@ -9,15 +9,25 @@ spring:
|
||||||
name: ruoyi-system
|
name: ruoyi-system
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: @profile.active@
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
|
# 注册中心
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: @discovery.server-addr@
|
||||||
|
# 配置命名空间
|
||||||
|
namespace: @config.namespaceId@
|
||||||
|
# 配置groupID
|
||||||
|
group: ${spring.profiles.active}
|
||||||
|
# 配置中心
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: @config.server-addr@
|
||||||
|
# 配置命名空间
|
||||||
|
namespace: @config.namespaceId@
|
||||||
|
# 配置groupID
|
||||||
|
group: ${spring.profiles.active}
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
||||||
|
|
@ -9,15 +9,25 @@ spring:
|
||||||
name: ruoyi-monitor
|
name: ruoyi-monitor
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: @profile.active@
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
|
# 注册中心
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: @discovery.server-addr@
|
||||||
|
# 配置命名空间
|
||||||
|
namespace: @config.namespaceId@
|
||||||
|
# 配置groupID
|
||||||
|
group: ${spring.profiles.active}
|
||||||
|
# 配置中心
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: @config.server-addr@
|
||||||
|
# 配置命名空间
|
||||||
|
namespace: @config.namespaceId@
|
||||||
|
# 配置groupID
|
||||||
|
group: ${spring.profiles.active}
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue