2019-05-19 18:54:09 +08:00
|
|
|
|
package org.jeecg;
|
|
|
|
|
|
2020-05-03 12:43:53 +08:00
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
2020-09-13 18:23:23 +08:00
|
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
2019-05-19 18:54:09 +08:00
|
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
2020-07-11 12:54:57 +08:00
|
|
|
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
|
|
|
|
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
2024-03-26 18:28:38 +08:00
|
|
|
|
import org.springframework.cache.annotation.EnableCaching;
|
2019-05-19 18:54:09 +08:00
|
|
|
|
import org.springframework.context.ConfigurableApplicationContext;
|
|
|
|
|
import org.springframework.core.env.Environment;
|
2019-08-24 00:15:45 +08:00
|
|
|
|
|
2020-05-03 12:43:53 +08:00
|
|
|
|
import java.net.InetAddress;
|
|
|
|
|
import java.net.UnknownHostException;
|
|
|
|
|
|
2020-12-02 20:13:45 +08:00
|
|
|
|
/**
|
2022-08-06 17:02:37 +08:00
|
|
|
|
* 单体启动类
|
|
|
|
|
* 报错提醒: 未集成mongo报错,可以打开启动类上面的注释 exclude={MongoAutoConfiguration.class}
|
2020-12-02 20:13:45 +08:00
|
|
|
|
*/
|
2019-05-19 18:54:09 +08:00
|
|
|
|
@Slf4j
|
|
|
|
|
@SpringBootApplication
|
2024-03-26 18:28:38 +08:00
|
|
|
|
@EnableCaching
|
2022-08-06 17:02:37 +08:00
|
|
|
|
//@EnableAutoConfiguration(exclude={MongoAutoConfiguration.class})
|
2020-09-13 18:23:23 +08:00
|
|
|
|
public class JeecgSystemApplication extends SpringBootServletInitializer {
|
2020-07-11 12:54:57 +08:00
|
|
|
|
|
2020-05-03 12:43:53 +08:00
|
|
|
|
@Override
|
2020-07-11 12:54:57 +08:00
|
|
|
|
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
2020-09-13 18:23:23 +08:00
|
|
|
|
return application.sources(JeecgSystemApplication.class);
|
2020-07-11 12:54:57 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) throws UnknownHostException {
|
2020-09-13 18:23:23 +08:00
|
|
|
|
ConfigurableApplicationContext application = SpringApplication.run(JeecgSystemApplication.class, args);
|
2020-07-11 12:54:57 +08:00
|
|
|
|
Environment env = application.getEnvironment();
|
|
|
|
|
String ip = InetAddress.getLocalHost().getHostAddress();
|
|
|
|
|
String port = env.getProperty("server.port");
|
2020-09-13 18:23:23 +08:00
|
|
|
|
String path = oConvertUtils.getString(env.getProperty("server.servlet.context-path"));
|
2020-07-11 12:54:57 +08:00
|
|
|
|
log.info("\n----------------------------------------------------------\n\t" +
|
|
|
|
|
"Application Jeecg-Boot is running! Access URLs:\n\t" +
|
|
|
|
|
"Local: \t\thttp://localhost:" + port + path + "/\n\t" +
|
|
|
|
|
"External: \thttp://" + ip + ":" + port + path + "/\n\t" +
|
2020-11-28 17:20:10 +08:00
|
|
|
|
"Swagger文档: \thttp://" + ip + ":" + port + path + "/doc.html\n" +
|
2020-07-11 12:54:57 +08:00
|
|
|
|
"----------------------------------------------------------");
|
2021-03-17 18:43:42 +08:00
|
|
|
|
|
2020-05-03 12:43:53 +08:00
|
|
|
|
}
|
2021-03-17 18:43:42 +08:00
|
|
|
|
|
2019-05-19 18:54:09 +08:00
|
|
|
|
}
|