Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
station
YeeAmosFireAutoSysRoot
Commits
6ad5919a
Commit
6ad5919a
authored
Jan 12, 2021
by
吴俊凯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对全局LONG 全局解析转换为String 类型,防止前台后失真
parent
4b9f47b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
LongJsonSerializer.java
.../java/com/yeejoin/amos/fas/config/LongJsonSerializer.java
+25
-0
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/config/LongJsonSerializer.java
0 → 100644
View file @
6ad5919a
package
com
.
yeejoin
.
amos
.
fas
.
config
;
/**
*
* 对全局LONG 全局解析转换为String 类型,防止前台后失真
*
* **/
import
com.fasterxml.jackson.core.JsonGenerator
;
import
com.fasterxml.jackson.databind.JsonSerializer
;
import
com.fasterxml.jackson.databind.SerializerProvider
;
import
org.springframework.boot.jackson.JsonComponent
;
import
java.io.IOException
;
@JsonComponent
public
class
LongJsonSerializer
extends
JsonSerializer
<
Long
>
{
@Override
public
void
serialize
(
Long
value
,
JsonGenerator
gen
,
SerializerProvider
serializers
)
throws
IOException
{
String
text
=
(
value
==
null
?
null
:
String
.
valueOf
(
value
));
if
(
text
!=
null
)
{
gen
.
writeString
(
text
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment