|
@@ -19,13 +19,22 @@ import springfox.documentation.oas.annotations.EnableOpenApi;
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
@EnableOpenApi
|
|
@EnableOpenApi
|
|
|
public class AucApplication {
|
|
public class AucApplication {
|
|
|
|
|
+ private static final String APPLICATION_TIME_ZONE = "Asia/Shanghai";
|
|
|
|
|
+
|
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
|
|
|
+ configureApplicationTimeZone();
|
|
|
SpringApplication.run(AucApplication.class, args);
|
|
SpringApplication.run(AucApplication.class, args);
|
|
|
log.info("(♥◠‿◠)ノ゙ app启动成功 ლ(´ڡ`ლ)゙");
|
|
log.info("(♥◠‿◠)ノ゙ app启动成功 ლ(´ڡ`ლ)゙");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ static void configureApplicationTimeZone() {
|
|
|
|
|
+ TimeZone.setDefault(TimeZone.getTimeZone(APPLICATION_TIME_ZONE));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Bean
|
|
@Bean
|
|
|
public Jackson2ObjectMapperBuilderCustomizer jacksonObjectMapperCustomization() {
|
|
public Jackson2ObjectMapperBuilderCustomizer jacksonObjectMapperCustomization() {
|
|
|
- return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.timeZone(TimeZone.getTimeZone("GMT+8"));
|
|
|
|
|
|
|
+ return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder
|
|
|
|
|
+ .timeZone(TimeZone.getTimeZone(APPLICATION_TIME_ZONE))
|
|
|
|
|
+ .simpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|