You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.6 KiB
52 lines
1.6 KiB
3 years ago
|
package com.qs.serve;
|
||
|
|
||
|
import com.qs.serve.common.config.DevEnvironmentConfig;
|
||
|
import org.springframework.boot.CommandLineRunner;
|
||
|
import org.springframework.boot.SpringApplication;
|
||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||
|
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||
|
import org.springframework.cache.annotation.EnableCaching;
|
||
|
import org.springframework.context.annotation.Bean;
|
||
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||
|
|
||
|
import javax.annotation.PostConstruct;
|
||
|
import javax.servlet.ServletContext;
|
||
|
import javax.servlet.ServletException;
|
||
|
import java.util.TimeZone;
|
||
|
|
||
|
/**
|
||
|
* @author YenHex
|
||
|
* @since 2022/2/24
|
||
|
*/
|
||
|
@EnableAsync
|
||
|
@EnableScheduling
|
||
|
@EnableTransactionManagement
|
||
|
@EnableCaching
|
||
|
@SpringBootApplication
|
||
|
public class Application extends SpringBootServletInitializer {
|
||
|
|
||
|
public static void main(String[] args) {
|
||
|
DevEnvironmentConfig.openDevEnv(true);
|
||
|
SpringApplication.run(Application.class,args);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void onStartup(ServletContext servletContext) throws ServletException {
|
||
|
super.onStartup(servletContext);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
|
||
|
return builder.sources(Application.class);
|
||
|
}
|
||
|
|
||
|
@PostConstruct
|
||
|
void started() {
|
||
|
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));
|
||
|
}
|
||
|
|
||
|
}
|