|
|
@@ -4551,4 +4551,21 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
$result['update_time'] = date('Y-m-d H:i:s', strtotime($latestUpdate));
|
|
|
return Result::success($result);
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 自助建站-ai会话-删除聊天记录
|
|
|
+ */
|
|
|
+ public function delAiChatRecord(array $data): array
|
|
|
+ {
|
|
|
+ $chat_id = $data['chat_id'];
|
|
|
+ $user_id = $data['user_id'];
|
|
|
+ $chat = AiChat::where('chat_id',$chat_id)->where('user_id',$user_id)->first();
|
|
|
+ if(empty($chat)){
|
|
|
+ return Result::error('此用户的聊天记录不存在!');
|
|
|
+ }
|
|
|
+ $del_chat = AiChat::where('chat_id',$chat_id)->where('user_id',$user_id)->delete();
|
|
|
+ if(empty($del_chat)){
|
|
|
+ return Result::error('删除失败!');
|
|
|
+ }
|
|
|
+ return Result::success(['删除成功']);
|
|
|
+ }
|
|
|
}
|