mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-13 21:53:41 +08:00
fix:
1.优化gpt上下文的能力 2.成员列表删除无效字段
This commit is contained in:
@@ -115,10 +115,6 @@
|
||||
<version>${junit.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.abin.mallchat.common.common.utils;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
/**
|
||||
@@ -19,6 +20,14 @@ public class JsonUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static JsonNode toJsonNode(String str) {
|
||||
try {
|
||||
return jsonMapper.readTree(str);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new UnsupportedOperationException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static String toStr(Object t) {
|
||||
try {
|
||||
return jsonMapper.writeValueAsString(t);
|
||||
@@ -26,4 +35,5 @@ public class JsonUtils {
|
||||
throw new UnsupportedOperationException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user