mirror of https://gitee.com/stylefeng/guns
【7.2.5】更新jackson注解内省
parent
94157a6918
commit
bac9f82ab1
|
@ -4,6 +4,7 @@ import cn.stylefeng.guns.core.error.CustomErrorAttributes;
|
|||
import cn.stylefeng.guns.core.security.AuthJwtTokenSecurityInterceptor;
|
||||
import cn.stylefeng.guns.core.security.PermissionSecurityInterceptor;
|
||||
import cn.stylefeng.roses.kernel.security.cors.CorsFilterConfiguration;
|
||||
import cn.stylefeng.roses.kernel.wrapper.field.jackson.CustomJacksonIntrospector;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
@ -50,7 +51,10 @@ public class SpringMvcConfiguration implements WebMvcConfigurer {
|
|||
*/
|
||||
@Bean
|
||||
public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer() {
|
||||
return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.serializerByType(Long.class, ToStringSerializer.instance).serializerByType(Long.TYPE, ToStringSerializer.instance);
|
||||
return jacksonObjectMapperBuilder -> {
|
||||
jacksonObjectMapperBuilder.serializerByType(Long.class, ToStringSerializer.instance).serializerByType(Long.TYPE, ToStringSerializer.instance);
|
||||
jacksonObjectMapperBuilder.annotationIntrospector(new CustomJacksonIntrospector());
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue