|
@@ -4,13 +4,17 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
|
|
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.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
|
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
|
|
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
|
|
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
|
|
|
|
|
+import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
|
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
|
|
import org.springframework.scheduling.annotation.EnableAsync;
|
|
import org.springframework.scheduling.annotation.EnableAsync;
|
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|
|
|
|
|
|
|
|
|
+import java.util.TimeZone;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 项目启动
|
|
* 项目启动
|
|
|
*/
|
|
*/
|
|
@@ -22,10 +26,23 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|
|
@EnableScheduling
|
|
@EnableScheduling
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
public class PoyeeDashboardApplication {
|
|
public class PoyeeDashboardApplication {
|
|
|
|
|
+ private static final String APPLICATION_TIME_ZONE = "Asia/Shanghai";
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
|
|
|
+ configureApplicationTimeZone();
|
|
|
SpringApplication.run(PoyeeDashboardApplication.class, args);
|
|
SpringApplication.run(PoyeeDashboardApplication.class, args);
|
|
|
log.info("(♥◠‿◠)ノ゙ 启动成功 ლ(´ڡ`ლ)゙");
|
|
log.info("(♥◠‿◠)ノ゙ 启动成功 ლ(´ڡ`ლ)゙");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ static void configureApplicationTimeZone() {
|
|
|
|
|
+ TimeZone.setDefault(TimeZone.getTimeZone(APPLICATION_TIME_ZONE));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Bean
|
|
|
|
|
+ public Jackson2ObjectMapperBuilderCustomizer jacksonObjectMapperCustomization() {
|
|
|
|
|
+ return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder
|
|
|
|
|
+ .timeZone(TimeZone.getTimeZone(APPLICATION_TIME_ZONE))
|
|
|
|
|
+ .simpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|