Pre Merge pull request !31 from 丨H丨/master
This commit is contained in:
commit
94c139059c
39
pom.xml
39
pom.xml
|
|
@ -233,6 +233,45 @@
|
|||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
<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>
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
package com.ruoyi.auth;
|
||||
|
||||
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
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
|
||||
@SpringCloudApplication
|
||||
@ComponentScan(basePackages ="com.ruoyi")
|
||||
public class RuoYiAuthApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
|
|
|
|||
|
|
@ -9,15 +9,25 @@ spring:
|
|||
name: ruoyi-auth
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
active: @profile.active@
|
||||
cloud:
|
||||
nacos:
|
||||
# 注册中心
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: @discovery.server-addr@
|
||||
# 配置命名空间
|
||||
namespace: @config.namespaceId@
|
||||
# 配置groupID
|
||||
group: ${spring.profiles.active}
|
||||
# 配置中心
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: @config.server-addr@
|
||||
# 配置命名空间
|
||||
namespace: @config.namespaceId@
|
||||
# 配置groupID
|
||||
group: ${spring.profiles.active}
|
||||
# 配置文件格式
|
||||
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
|
||||
*/
|
||||
@EnableDiscoveryClient
|
||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
|
||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class }, scanBasePackages = {"com.ruoyi"})
|
||||
public class RuoYiGatewayApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
|
|
|
|||
|
|
@ -9,17 +9,27 @@ spring:
|
|||
name: ruoyi-gateway
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
active: @profile.active@
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
cloud:
|
||||
nacos:
|
||||
# 注册中心
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: @discovery.server-addr@
|
||||
# 配置命名空间
|
||||
namespace: @config.namespaceId@
|
||||
# 配置groupID
|
||||
group: ${spring.profiles.active}
|
||||
# 配置中心
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: @config.server-addr@
|
||||
# 配置命名空间
|
||||
namespace: @config.namespaceId@
|
||||
# 配置groupID
|
||||
group: ${spring.profiles.active}
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
@ -34,8 +44,8 @@ spring:
|
|||
datasource:
|
||||
ds1:
|
||||
nacos:
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: @config.server-addr@
|
||||
dataId: sentinel-ruoyi-gateway
|
||||
groupId: DEFAULT_GROUP
|
||||
groupId: ${spring.profiles.active}
|
||||
data-type: json
|
||||
rule-type: flow
|
||||
|
|
|
|||
|
|
@ -9,15 +9,25 @@ spring:
|
|||
name: ruoyi-file
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
active: @profile.active@
|
||||
cloud:
|
||||
nacos:
|
||||
# 注册中心
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: @discovery.server-addr@
|
||||
# 配置命名空间
|
||||
namespace: @config.namespaceId@
|
||||
# 配置groupID
|
||||
group: ${spring.profiles.active}
|
||||
# 配置中心
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: @config.server-addr@
|
||||
# 配置命名空间
|
||||
namespace: @config.namespaceId@
|
||||
# 配置groupID
|
||||
group: ${spring.profiles.active}
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -9,15 +9,25 @@ spring:
|
|||
name: ruoyi-gen
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
active: @profile.active@
|
||||
cloud:
|
||||
nacos:
|
||||
# 注册中心
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: @discovery.server-addr@
|
||||
# 配置命名空间
|
||||
namespace: @config.namespaceId@
|
||||
# 配置groupID
|
||||
group: ${spring.profiles.active}
|
||||
# 配置中心
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: @config.server-addr@
|
||||
# 配置命名空间
|
||||
namespace: @config.namespaceId@
|
||||
# 配置groupID
|
||||
group: ${spring.profiles.active}
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -9,15 +9,25 @@ spring:
|
|||
name: ruoyi-job
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
active: @profile.active@
|
||||
cloud:
|
||||
nacos:
|
||||
# 注册中心
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: @discovery.server-addr@
|
||||
# 配置命名空间
|
||||
namespace: @config.namespaceId@
|
||||
# 配置groupID
|
||||
group: ${spring.profiles.active}
|
||||
# 配置中心
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: @config.server-addr@
|
||||
# 配置命名空间
|
||||
namespace: @config.namespaceId@
|
||||
# 配置groupID
|
||||
group: ${spring.profiles.active}
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
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.EnableRyFeignClients;
|
||||
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
|
||||
@EnableRyFeignClients
|
||||
@SpringCloudApplication
|
||||
@ComponentScan(basePackages ="com.ruoyi")
|
||||
public class RuoYiSystemApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
|
|
|
|||
|
|
@ -9,15 +9,25 @@ spring:
|
|||
name: ruoyi-system
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
active: @profile.active@
|
||||
cloud:
|
||||
nacos:
|
||||
# 注册中心
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: @discovery.server-addr@
|
||||
# 配置命名空间
|
||||
namespace: @config.namespaceId@
|
||||
# 配置groupID
|
||||
group: ${spring.profiles.active}
|
||||
# 配置中心
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: @config.server-addr@
|
||||
# 配置命名空间
|
||||
namespace: @config.namespaceId@
|
||||
# 配置groupID
|
||||
group: ${spring.profiles.active}
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -9,15 +9,25 @@ spring:
|
|||
name: ruoyi-monitor
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
active: @profile.active@
|
||||
cloud:
|
||||
nacos:
|
||||
# 注册中心
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: @discovery.server-addr@
|
||||
# 配置命名空间
|
||||
namespace: @config.namespaceId@
|
||||
# 配置groupID
|
||||
group: ${spring.profiles.active}
|
||||
# 配置中心
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: @config.server-addr@
|
||||
# 配置命名空间
|
||||
namespace: @config.namespaceId@
|
||||
# 配置groupID
|
||||
group: ${spring.profiles.active}
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
Loading…
Reference in New Issue