Compare commits
No commits in common. "1f3e63a8a868fc9b90fa6ebb7b99b6c711cccfb9" and "0c1308335bd7e44b6b38c65d1904eba7ab42f18a" have entirely different histories.
1f3e63a8a8
...
0c1308335b
|
|
@ -1,17 +1,9 @@
|
|||
|
||||
package com.unisinsight.project;
|
||||
|
||||
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.core.env.Environment;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
/**
|
||||
* 分片上传应用启动类
|
||||
|
|
@ -21,21 +13,7 @@ import java.net.UnknownHostException;
|
|||
@EnableFeignClients(basePackages = "com.unisinsight.project.feign")
|
||||
public class Application {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(Application.class);
|
||||
|
||||
public static void main(String[] args) {
|
||||
ConfigurableApplicationContext context = SpringApplication.run(Application.class, args);
|
||||
|
||||
try {
|
||||
// 获取当前服务器IP地址
|
||||
String ip = InetAddress.getLocalHost().getHostAddress();
|
||||
// 从Spring环境变量中获取配置的端口
|
||||
Environment env = context.getBean(Environment.class);
|
||||
String port = env.getProperty("server.port", "8080");
|
||||
// 使用日志打印完整的Swagger地址
|
||||
logger.info("Swagger UI 地址: http://{}:{}/doc.html", ip, port);
|
||||
} catch (UnknownHostException e) {
|
||||
logger.warn("无法获取本机IP地址", e);
|
||||
}
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue