package cn.hobbystocks.auc; import com.dtflys.forest.springboot.annotation.ForestScan; import lombok.extern.slf4j.Slf4j; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; import org.springframework.context.annotation.Bean; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; import springfox.documentation.oas.annotations.EnableOpenApi; import java.util.TimeZone; @ForestScan(basePackages = "cn.hobbystocks.auc.forest") @MapperScan("cn/hobbystocks/auc/mapper") @EnableScheduling @EnableAsync @SpringBootApplication @Slf4j @EnableOpenApi public class BidApplication { private static final String APPLICATION_TIME_ZONE = "Asia/Shanghai"; public static void main(String[] args) { configureApplicationTimeZone(); SpringApplication.run(BidApplication.class, args); log.info("(♥◠‿◠)ノ゙ app启动成功 ლ(´ڡ`ლ)゙"); } 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"); } }