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;
|
2022-02-24 15:13:05 +08:00
|
|
|
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
2019-05-19 18:54:09 +08:00
|
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
2022-02-24 15:13:05 +08:00
|
|
|
|
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
|
2020-07-11 12:54:57 +08:00
|
|
|
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
|
|
|
|
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
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
|
|
|
|
/**
|
2021-01-23 23:59:31 +08:00
|
|
|
|
* 单体启动类(采用此类启动为单体模式)
|
2022-05-24 17:50:55 +08:00
|
|
|
|
* 特别提醒:
|
2022-05-31 10:35:46 +08:00
|
|
|
|
* 1.需要集成mongodb请删除 exclude={MongoAutoConfiguration.class}
|
2022-05-24 17:50:55 +08:00
|
|
|
|
* 2.切换微服务 勾选profile的SpringCloud,这个类就无法启动,启动会报错
|
2020-12-02 20:13:45 +08:00
|
|
|
|
*/
|
2019-05-19 18:54:09 +08:00
|
|
|
|
@Slf4j
|
|
|
|
|
@SpringBootApplication
|
2022-02-24 15:13:05 +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
|
|
|
|
}
|