|
@@ -1,16 +1,37 @@
|
|
package com.gyee.runeconomy;
|
|
package com.gyee.runeconomy;
|
|
|
|
|
|
|
|
+import lombok.extern.log4j.Log4j2;
|
|
import org.mybatis.spring.annotation.MapperScan;
|
|
import org.mybatis.spring.annotation.MapperScan;
|
|
import org.springframework.boot.SpringApplication;
|
|
import org.springframework.boot.SpringApplication;
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
|
+import org.springframework.context.ConfigurableApplicationContext;
|
|
|
|
+import org.springframework.core.env.Environment;
|
|
|
|
|
|
|
|
+import java.net.InetAddress;
|
|
|
|
+import java.net.UnknownHostException;
|
|
|
|
|
|
|
|
+
|
|
|
|
+@Log4j2
|
|
@SpringBootApplication
|
|
@SpringBootApplication
|
|
@MapperScan("com.gyee.runeconomy.mapper")
|
|
@MapperScan("com.gyee.runeconomy.mapper")
|
|
public class RunEconomyApplication {
|
|
public class RunEconomyApplication {
|
|
|
|
|
|
- public static void main(String[] args) {
|
|
|
|
- SpringApplication.run(RunEconomyApplication.class, args);
|
|
|
|
|
|
+ public static void main(String[] args) throws UnknownHostException {
|
|
|
|
+ ConfigurableApplicationContext application = SpringApplication.run(RunEconomyApplication.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");
|
|
|
|
+
|
|
|
|
+ log.info("\n-------------------------------------------------------------------\n\t" +
|
|
|
|
+ "经济运行系统启动成功,访问路径如下:\n\t" +
|
|
|
|
+ "本地路径: \t\thttp://localhost:" + port + path + "\n\t" +
|
|
|
|
+ "网络地址: \t\thttp://" + ip + ":" + port + path + "\n\t" +
|
|
|
|
+ "API文档: \t\thttp://" + ip + ":" + port + path + "/swagger-ui.html\n" +
|
|
|
|
+ "-----------------------------------------------------------------------");
|
|
|
|
+
|
|
|
|
|
|
// CacheService cacheService= SpringUtils.getBean("cacheService");
|
|
// CacheService cacheService= SpringUtils.getBean("cacheService");
|
|
// cacheService.initRedisCache();
|
|
// cacheService.initRedisCache();
|