Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Pangea-Agent
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
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
Gavin-Group
Pangea-Agent
Commits
31c51157
Commit
31c51157
authored
Dec 29, 2025
by
youxiaoji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+ [增加表单提交后会话删除功能]
parent
1dc90ff8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
AgentDialogueRepository.java
...angea/hiagent/web/repository/AgentDialogueRepository.java
+4
-0
ChatService.java
...src/main/java/pangea/hiagent/web/service/ChatService.java
+6
-0
No files found.
backend/src/main/java/pangea/hiagent/web/repository/AgentDialogueRepository.java
View file @
31c51157
package
pangea
.
hiagent
.
web
.
repository
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Delete
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Select
;
import
pangea.hiagent.model.AgentDialogue
;
/**
...
...
@@ -9,4 +11,6 @@ import pangea.hiagent.model.AgentDialogue;
*/
@Mapper
public
interface
AgentDialogueRepository
extends
BaseMapper
<
AgentDialogue
>
{
@Delete
(
"DELETE FROM agent_dialogue WHERE user_id = #{userId} AND agent_id=#{agentId} "
)
public
void
deleteDialogue
(
String
userId
,
String
agentId
);
}
backend/src/main/java/pangea/hiagent/web/service/ChatService.java
View file @
31c51157
package
pangea
.
hiagent
.
web
.
service
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
pangea.hiagent.web.repository.AgentDialogueRepository
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentMap
;
...
...
@@ -10,6 +12,9 @@ import java.util.concurrent.ConcurrentMap;
@Service
public
class
ChatService
{
@Autowired
private
AgentDialogueRepository
agentDialogueRepository
;
private
final
ConcurrentMap
<
String
,
String
>
chatList
=
new
ConcurrentHashMap
<>(
1024
);
public
boolean
chatExists
(
String
userId
,
String
agentId
)
{
...
...
@@ -26,6 +31,7 @@ public class ChatService {
String
chatId
=
buildChatId
(
userId
,
agentId
);
log
.
info
(
"remove chatId:{}"
,
chatId
);
chatList
.
remove
(
chatId
);
agentDialogueRepository
.
deleteDialogue
(
userId
,
agentId
);
}
private
String
buildChatId
(
String
userId
,
String
agentId
)
{
...
...
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