Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
4822174c5e
@ -0,0 +1,18 @@
|
||||
package com.ycwl.basic.config;
|
||||
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class JacksonConfiguration {
|
||||
|
||||
@Bean
|
||||
public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer() {
|
||||
return builder -> {
|
||||
// 把 Long 类型序列化为 String
|
||||
builder.serializerByType(Long.class, ToStringSerializer.instance);
|
||||
};
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user