Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Eladmin
Commits
1556f133
Commit
1556f133
authored
Dec 22, 2020
by
zhengjie
Browse files
[代码优化](v2.6):使用 fastJson 防止 Long 精度丢失
parent
2a3e4cd9
Changes
2
Hide whitespace changes
Inline
Side-by-side
eladmin-system/src/main/java/me/zhengjie/modules/system/domain/vo/MenuVo.java
View file @
1556f133
...
...
@@ -17,7 +17,6 @@ package me.zhengjie.modules.system.domain.vo;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
...
...
eladmin-system/src/main/resources/template/generator/admin/Dto.ftl
View file @
1556f133
...
...
@@ -24,8 +24,8 @@ import java.math.BigDecimal;
</#
if
>
import
java.io.Serializable;
<#
if
!auto && pkColumnType = 'Long'>
import
com.
fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.
fasterxml.jackson.databind.ser.std
.ToStringSerializer;
import
com.
alibaba.fastjson.annotation.JSONField
;
import
com.
alibaba.fastjson.serializer
.ToStringSerializer;
</#
if
>
/**
...
...
@@ -45,7 +45,7 @@ public class ${className}Dto implements Serializable {
<#
if
column
.columnKey
=
'
PRI
'>
<#
if
!
auto
&&
pkColumnType
=
'
L
ong
'>
/
**
防止精度丢失
*
/
@
J
sonS
erialize
(
u
sing
=
T
oStringSerializer
.class
)
@
J
SONF
ield
(
s
erialize
U
sing
=
T
oStringSerializer
.class
)
</#
if
>
</#
if
>
private
$
{
column
.columnType
}
$
{
column
.changeColumnName
}
;
...
...
Write
Preview
Supports
Markdown
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