From aab7f9e325d9a38dccc24a936ac974dbea2a8077 Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期三, 07 九月 2022 13:19:56 +0800
Subject: [PATCH] 配置

---
 ycl-platform/src/main/resources/application-pro.yml         |    5 +++++
 ycl-platform/src/main/resources/application-dev.yml         |    5 +++++
 ycl-platform/src/main/java/com/ycl/PlatformApplication.java |   34 ++++++++++++++++++++++++++++++++--
 3 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/ycl-platform/src/main/java/com/ycl/PlatformApplication.java b/ycl-platform/src/main/java/com/ycl/PlatformApplication.java
index fa37ccd..e668187 100644
--- a/ycl-platform/src/main/java/com/ycl/PlatformApplication.java
+++ b/ycl-platform/src/main/java/com/ycl/PlatformApplication.java
@@ -1,13 +1,43 @@
 package com.ycl;
 
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.core.env.Environment;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
 
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+@Slf4j
+@Configuration
+@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true)
+@EnableAsync(proxyTargetClass = true)
+@EnableScheduling
+@EnableTransactionManagement(proxyTargetClass = true)
 @SpringBootApplication
 public class PlatformApplication {
 
-    public static void main(String[] args) {
-        SpringApplication.run(PlatformApplication.class, args);
+    public static void main(String[] args) throws UnknownHostException {
+        ConfigurableApplicationContext application = SpringApplication.run(PlatformApplication.class, args);
+
+        Environment env = application.getEnvironment();
+        log.info("\n----------------------------------------------------------\n\t" +
+                        "搴旂敤 '{}' 杩愯鎴愬姛! 璁块棶杩炴帴:\n\t" +
+                        "Swagger鏂囨。: \t\thttp://{}:{}{}/doc.html\n\t" +
+                        "鏁版嵁搴撶洃鎺�: \t\thttp://{}:{}/druid\n" +
+                        "----------------------------------------------------------",
+                env.getProperty("spring.application.name"),
+                InetAddress.getLocalHost().getHostAddress(),
+                env.getProperty("server.port"),
+                env.getProperty("server.servlet.context-path"),
+                "127.0.0.1",
+                env.getProperty("server.port"));
     }
 
 }
diff --git a/ycl-platform/src/main/resources/application-dev.yml b/ycl-platform/src/main/resources/application-dev.yml
index 43c046b..582766f 100644
--- a/ycl-platform/src/main/resources/application-dev.yml
+++ b/ycl-platform/src/main/resources/application-dev.yml
@@ -1,5 +1,10 @@
 server:
   port: 8081
+  tomcat:
+    uri-encoding: UTF-8
+  servlet:
+    context-path: /sccg
+    compression: true
 spring:
   redis:
     database: 0
diff --git a/ycl-platform/src/main/resources/application-pro.yml b/ycl-platform/src/main/resources/application-pro.yml
index aa4a7a3..ce02925 100644
--- a/ycl-platform/src/main/resources/application-pro.yml
+++ b/ycl-platform/src/main/resources/application-pro.yml
@@ -1,5 +1,10 @@
 server:
   port: 8081
+  tomcat:
+    uri-encoding: UTF-8
+  servlet:
+    context-path: /sccg
+    compression: true
 spring:
   redis:
     database: 0

--
Gitblit v1.8.0