Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
182fe054
Commit
182fe054
authored
Nov 17, 2021
by
xinglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*)增加JSON空值显示
parent
f867bae5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
RuleUtils.java
...ava/com/yeejoin/amos/boot/biz/common/utils/RuleUtils.java
+2
-1
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/RuleUtils.java
View file @
182fe054
package
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
utils
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.util.Map
;
...
...
@@ -13,7 +14,7 @@ import java.util.Map;
public
class
RuleUtils
{
public
static
String
instedParams
(
String
content
,
Object
msgObj
)
{
Map
<
String
,
Object
>
strengthMap
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
msgObj
),
Map
.
class
);
Map
<
String
,
Object
>
strengthMap
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
msgObj
,
SerializerFeature
.
WriteMapNullValue
),
Map
.
class
);
for
(
String
key
:
strengthMap
.
keySet
())
content
=
content
.
replaceAll
(
"\\$\\{"
+
key
+
"}"
,
String
.
valueOf
(
ValidationUtil
.
isEmpty
(
strengthMap
.
get
(
key
))
?
""
:
strengthMap
.
get
(
key
)));
return
content
;
...
...
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