|
|
|
@ -33,7 +33,7 @@ public class BigNumberSerializer extends NumberSerializer {
|
|
|
|
|
@Override
|
|
|
|
|
public void serialize(Number value, JsonGenerator gen, SerializerProvider provider) throws IOException {
|
|
|
|
|
// 超出范围 序列化位字符串
|
|
|
|
|
if (value.longValue() > MAX_SAFE_INTEGER && value.longValue() < MIN_SAFE_INTEGER) {
|
|
|
|
|
if (value.longValue() > MIN_SAFE_INTEGER && value.longValue() < MAX_SAFE_INTEGER) {
|
|
|
|
|
super.serialize(value, gen, provider);
|
|
|
|
|
} else {
|
|
|
|
|
gen.writeString(value.toString());
|
|
|
|
|