| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- package com.poyee;
- import lombok.extern.slf4j.Slf4j;
- import org.springframework.boot.SpringApplication;
- 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.security.servlet.SecurityAutoConfiguration;
- import org.springframework.context.annotation.Bean;
- import org.springframework.context.annotation.EnableAspectJAutoProxy;
- import org.springframework.scheduling.annotation.EnableAsync;
- import org.springframework.scheduling.annotation.EnableScheduling;
- import org.springframework.transaction.annotation.EnableTransactionManagement;
- import java.util.TimeZone;
- /**
- * 项目启动
- */
- @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, SecurityAutoConfiguration.class }
- , scanBasePackages = {"com.poyee"})
- @EnableAsync
- @EnableAspectJAutoProxy(proxyTargetClass = true)
- @EnableTransactionManagement
- @EnableScheduling
- @Slf4j
- public class PoyeeDashboardApplication {
- private static final String APPLICATION_TIME_ZONE = "Asia/Shanghai";
- public static void main(String[] args) {
- configureApplicationTimeZone();
- SpringApplication.run(PoyeeDashboardApplication.class, args);
- 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");
- }
- }
|