添加Jackson时区配置

pull/7/MERGE
RuoYi 4 years ago
parent bea2f32781
commit 029fe5c63f

@ -10,6 +10,7 @@ import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.Import;
import org.springframework.scheduling.annotation.EnableAsync;
import com.ruoyi.common.security.config.ApplicationConfig;
import com.ruoyi.common.security.config.SecurityImportBeanDefinitionRegistrar;
@Target(ElementType.TYPE)
@ -23,7 +24,7 @@ import com.ruoyi.common.security.config.SecurityImportBeanDefinitionRegistrar;
// 开启线程异步执行
@EnableAsync
// 自动加载类
@Import(SecurityImportBeanDefinitionRegistrar.class)
@Import({ SecurityImportBeanDefinitionRegistrar.class, ApplicationConfig.class })
public @interface EnableCustomConfig
{

@ -0,0 +1,22 @@
package com.ruoyi.common.security.config;
import java.util.TimeZone;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.context.annotation.Bean;
/**
*
*
* @author ruoyi
*/
public class ApplicationConfig
{
/**
*
*/
@Bean
public Jackson2ObjectMapperBuilderCustomizer jacksonObjectMapperCustomization()
{
return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.timeZone(TimeZone.getDefault());
}
}
Loading…
Cancel
Save