|
|
@@ -5,6 +5,7 @@ import cn.qinys.platform.entity.wishing.ChatMessage;
|
|
|
import cn.qinys.platform.mobile.mapper.ChatMessageMapper;
|
|
|
import cn.qinys.platform.mobile.resp.ChatHistoryResp;
|
|
|
import cn.qinys.platform.mobile.service.ChatService;
|
|
|
+import cn.qinys.platform.mobile.tool.DateTimeTools;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import jakarta.annotation.Resource;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -23,6 +24,7 @@ public class ChatServiceImpl implements ChatService {
|
|
|
@Resource
|
|
|
private ChatMessageMapper chatMessageMapper;
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
public String chat(String message, Integer treeId) {
|
|
|
String userId = getUserId();
|
|
|
@@ -34,6 +36,7 @@ public class ChatServiceImpl implements ChatService {
|
|
|
try {
|
|
|
reply = chatClient.prompt()
|
|
|
.user(message)
|
|
|
+ .tools(new DateTimeTools())
|
|
|
.call()
|
|
|
.content();
|
|
|
} catch (Exception e) {
|
|
|
@@ -47,6 +50,8 @@ public class ChatServiceImpl implements ChatService {
|
|
|
return reply;
|
|
|
}
|
|
|
|
|
|
+ // ...existing code...
|
|
|
+
|
|
|
@Override
|
|
|
public ChatHistoryResp getHistory(Integer treeId) {
|
|
|
String userId = getUserId();
|