Ver Fonte

Merge branch 'usky-cloud-2' of uskycloud/usky-cloud into master

gez há 2 anos atrás
pai
commit
12bcc7e09b

+ 5 - 0
base-modules/service-system/service-system-biz/pom.xml

@@ -43,6 +43,11 @@
             <artifactId>ruoyi-common-core</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>com.usky</groupId>
+            <artifactId>ruoyi-common-swagger</artifactId>
+        </dependency>
+
     </dependencies>
 
     <build>

+ 23 - 14
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/RuoYiSystemApplication.java

@@ -1,12 +1,20 @@
 package com.usky.system;
 
 
+import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
 import org.mybatis.spring.annotation.MapperScan;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.openfeign.EnableFeignClients;
+import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.core.env.Environment;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
 
 /**
  * 系统模块
@@ -14,7 +22,7 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
  * @author ruoyi
  */
 
-
+@EnableCustomSwagger2
 @EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true)
 @EnableFeignClients(basePackages = {"com.usky"})
 @MapperScan(value = "com.usky.system.mapper")
@@ -22,18 +30,19 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
 @SpringBootApplication
 public class RuoYiSystemApplication
 {
-    public static void main(String[] args)
-    {
-        SpringApplication.run(RuoYiSystemApplication.class, args);
-        System.out.println("(♥◠‿◠)ノ゙  永天系统模块启动成功   ლ(´ڡ`ლ)゙  \n" +
-                " .-------.       ____     __        \n" +
-                " |  _ _   \\      \\   \\   /  /    \n" +
-                " | ( ' )  |       \\  _. /  '       \n" +
-                " |(_ o _) /        _( )_ .'         \n" +
-                " | (_,_).' __  ___(_ o _)'          \n" +
-                " |  |\\ \\  |  ||   |(_,_)'         \n" +
-                " |  | \\ `'   /|   `-'  /           \n" +
-                " |  |  \\    /  \\      /           \n" +
-                " ''-'   `'-'    `-..-'              ");
+    private static final Logger LOGGER = LoggerFactory.getLogger(RuoYiSystemApplication.class);
+
+    public static void main(String[] args) throws UnknownHostException {
+        ConfigurableApplicationContext application = SpringApplication.run(RuoYiSystemApplication.class, args);
+        Environment env = application.getEnvironment();
+        String ip = InetAddress.getLocalHost().getHostAddress();
+        String port = env.getProperty("server.port");
+        String path = env.getProperty("server.servlet.context-path");
+        LOGGER.info("\n----------------------------------------------------------\n\t" +
+                "Application is running! Access URLs:\n\t" +
+                "Local: \t\thttp://localhost:" + port + (null==path?"":path) + "/\n\t" +
+                "External: \thttp://" + ip + ":" + port + (null==path?"":path) + "/\n\t" +
+                "Api: \t\thttp://" + ip + ":" + port + (null==path?"":path) + "/swagger-ui/index.html\n\t" +
+                "----------------------------------------------------------");
     }
 }

+ 1 - 1
base-modules/service-system/service-system-biz/src/main/resources/bootstrap.yml

@@ -5,7 +5,7 @@ server:
 spring:
   application:
     # 应用名称
-    name: usky-system
+    name: service-system
   profiles:
     # 环境配置
     active: dev

+ 1 - 0
base-modules/service-system/service-system-biz/src/main/resources/logback.xml

@@ -88,5 +88,6 @@
         <appender-ref ref="file_info" />
         <appender-ref ref="file_error" />
         <appender-ref ref="console" />
+        <appender-ref ref="file_sql"/>
     </root>
 </configuration>