forked from datageartech/datagear
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
修复数据管理列表/编辑页面、SQL工作台查询结果对于大整数无法精确显示的BUG
- Loading branch information
interestinglife
committed
Aug 24, 2021
1 parent
3caa92d
commit f055f50
Showing
8 changed files
with
211 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
datagear-web/src/main/java/org/datagear/web/json/jackson/BigIntegerToStringSerializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright 2018 datagear.tech | ||
* | ||
* Licensed under the LGPLv3 license: | ||
* http://www.gnu.org/licenses/lgpl-3.0.html | ||
*/ | ||
|
||
package org.datagear.web.json.jackson; | ||
|
||
import java.io.IOException; | ||
import java.math.BigInteger; | ||
|
||
import com.fasterxml.jackson.core.JsonGenerator; | ||
import com.fasterxml.jackson.databind.JsonSerializer; | ||
import com.fasterxml.jackson.databind.SerializerProvider; | ||
|
||
/** | ||
* {@linkplain BigInteger}型作为字符串输出的{@linkplain JsonSerializer}。 | ||
* | ||
* @author [email protected] | ||
* | ||
* @param <T> | ||
*/ | ||
public class BigIntegerToStringSerializer extends JsonSerializer<BigInteger> | ||
{ | ||
public BigIntegerToStringSerializer() | ||
{ | ||
super(); | ||
} | ||
|
||
@Override | ||
public void serialize(BigInteger value, JsonGenerator gen, SerializerProvider serializers) throws IOException | ||
{ | ||
String str = (value == null ? null : value.toString()); | ||
serializers.defaultSerializeValue(str, gen); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
datagear-web/src/main/java/org/datagear/web/json/jackson/LongToStringSerializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright 2018 datagear.tech | ||
* | ||
* Licensed under the LGPLv3 license: | ||
* http://www.gnu.org/licenses/lgpl-3.0.html | ||
*/ | ||
|
||
package org.datagear.web.json.jackson; | ||
|
||
import java.io.IOException; | ||
|
||
import com.fasterxml.jackson.core.JsonGenerator; | ||
import com.fasterxml.jackson.databind.JsonSerializer; | ||
import com.fasterxml.jackson.databind.SerializerProvider; | ||
|
||
/** | ||
* {@linkplain Long}型作为字符串输出的{@linkplain JsonSerializer}。 | ||
* | ||
* @author [email protected] | ||
* | ||
* @param <T> | ||
*/ | ||
public class LongToStringSerializer extends JsonSerializer<Long> | ||
{ | ||
public LongToStringSerializer() | ||
{ | ||
super(); | ||
} | ||
|
||
@Override | ||
public void serialize(Long value, JsonGenerator gen, SerializerProvider serializers) throws IOException | ||
{ | ||
String str = (value == null ? null : value.toString()); | ||
serializers.defaultSerializeValue(str, gen); | ||
} | ||
} |
Oops, something went wrong.