|
@@ -1,6 +1,7 @@
|
|
|
package org.ssssssss.magicapi.spring.boot.starter;
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.boot.CommandLineRunner;
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
|
import org.springframework.core.annotation.Order;
|
|
@@ -23,7 +24,8 @@ import java.net.UnknownHostException;
|
|
|
public class ApplicationUriPrinter implements CommandLineRunner {
|
|
|
@Resource
|
|
|
private ConfigurableEnvironment springEnv;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private MagicAPIProperties properties;
|
|
|
@Override
|
|
|
public void run(String... args) throws Exception {
|
|
|
System.out.println("****************************************************当前服务相关地址start****************************************************");
|
|
@@ -35,9 +37,7 @@ public class ApplicationUriPrinter implements CommandLineRunner {
|
|
|
}
|
|
|
String port = springEnv.getProperty("server.port","port");
|
|
|
String path =springEnv.getProperty("server.servlet.context-path","");
|
|
|
- String magicWebPath =springEnv.getProperty("magic-api.web","");
|
|
|
-
|
|
|
-
|
|
|
+ String magicWebPath =properties.getWeb();
|
|
|
System.out.println(
|
|
|
"服务启动成功,magic-api已内置启动! Access URLs:\n\t" +
|
|
|
"接口本地地址: \t\thttp://localhost:" + port + path + "/\n\t" +
|
|
@@ -47,8 +47,7 @@ public class ApplicationUriPrinter implements CommandLineRunner {
|
|
|
if(!magicWebPath.startsWith("/")){
|
|
|
magicWebPath="/"+magicWebPath;
|
|
|
}
|
|
|
- System.out.println("\t接口配置平台: \t\thttp://" + ip + ":" + port +path+ magicWebPath + "/index.html\n"
|
|
|
- );
|
|
|
+ System.out.println("\t接口配置平台: \t\thttp://" + ip + ":" + port +path+ magicWebPath + "/index.html\n");
|
|
|
}
|
|
|
|
|
|
System.out.println("****************************************************当前服务相关地址end 可通过配置关闭输出magic-api.show-url=false****************************************************");
|