crm-print/server/src/main/java/cn/keking/ServerMain.java
2022-07-15 14:41:46 +08:00

33 lines
1.1 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package cn.keking;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.util.StopWatch;
/**
* @author Hikaru
*/
@SpringBootApplication
@EnableScheduling
public class ServerMain {
private static final Logger logger = LoggerFactory.getLogger(ServerMain.class);
public static void main(String[] args) {
StopWatch stopWatch = new StopWatch();
stopWatch.start();
ConfigurableApplicationContext context = new SpringApplicationBuilder(ServerMain.class)
.logStartupInfo(false)
.run(args);
stopWatch.stop();
Integer port = context.getBean(ServerProperties.class).getPort();
logger.info("服务启动完成,耗时:{}s演示页请访问: http://127.0.0.1:{} ", stopWatch.getTotalTimeSeconds(), port);
}
}