Skip to content

Commit 4df6ecb

Browse files
committed
Remove fastjson, Use default jackson
1 parent d10ac94 commit 4df6ecb

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

core/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@
6262
<groupId>org.projectlombok</groupId>
6363
<artifactId>lombok</artifactId>
6464
</dependency>
65-
<dependency>
66-
<groupId>com.alibaba</groupId>
67-
<artifactId>fastjson</artifactId>
68-
</dependency>
6965
</dependencies>
7066

7167
<build>

core/src/main/java/lazy/fast/code/core/result/ResultMsg.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package lazy.fast.code.core.result;
22

3-
import com.alibaba.fastjson.JSON;
43
import com.fasterxml.jackson.annotation.JsonInclude;
4+
import com.fasterxml.jackson.core.JsonProcessingException;
5+
import com.fasterxml.jackson.databind.ObjectMapper;
6+
import lazy.fast.code.core.exception.SystemException;
57
import lombok.Getter;
68
import lombok.Setter;
79

@@ -92,7 +94,11 @@ private static ResultMsg of(int code, String msg, String detailMsg) {
9294
*/
9395
@Override
9496
public String toString() {
95-
return JSON.toJSONString(this);
97+
try {
98+
return new ObjectMapper().writeValueAsString(this);
99+
} catch (JsonProcessingException e) {
100+
throw new SystemException("ResultMsg to json string error");
101+
}
96102
}
97103

98104
}

0 commit comments

Comments
 (0)