Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-api
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
poc
poc-api
Commits
d6f0352c
Commit
d6f0352c
authored
Nov 13, 2024
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化记忆函数主键
parent
4428dadb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
AgentApplicationInfoRestImpl.java
...t_application/rest/impl/AgentApplicationInfoRestImpl.java
+6
-3
No files found.
src/main/java/cn/com/poc/agent_application/rest/impl/AgentApplicationInfoRestImpl.java
View file @
d6f0352c
...
@@ -374,7 +374,8 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
...
@@ -374,7 +374,8 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
public
List
<
AgentLongMemoryDto
>
getLongMemoryList
(
String
agentId
)
{
public
List
<
AgentLongMemoryDto
>
getLongMemoryList
(
String
agentId
)
{
Assert
.
notNull
(
agentId
);
Assert
.
notNull
(
agentId
);
List
<
AgentLongMemoryDto
>
result
=
new
ArrayList
<>();
List
<
AgentLongMemoryDto
>
result
=
new
ArrayList
<>();
String
contentKey
=
SetLongMemoryConstants
.
REDIS_PREFIX
+
agentId
+
":"
+
BlContext
.
getCurrentUserNotException
().
getUserId
().
toString
();
String
key
=
agentId
+
":"
+
agentId
;
String
contentKey
=
SetLongMemoryConstants
.
REDIS_PREFIX
+
key
+
":"
+
BlContext
.
getCurrentUserNotException
().
getUserId
().
toString
();
Map
<
Object
,
Object
>
map
=
redisService
.
hmget
(
contentKey
);
Map
<
Object
,
Object
>
map
=
redisService
.
hmget
(
contentKey
);
Set
<
Object
>
keySet
=
map
.
keySet
();
Set
<
Object
>
keySet
=
map
.
keySet
();
...
@@ -391,14 +392,16 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
...
@@ -391,14 +392,16 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
public
void
deleteLongMemoryByKey
(
String
agentId
,
String
timestamp
)
{
public
void
deleteLongMemoryByKey
(
String
agentId
,
String
timestamp
)
{
Assert
.
notNull
(
agentId
);
Assert
.
notNull
(
agentId
);
Assert
.
notNull
(
timestamp
);
Assert
.
notNull
(
timestamp
);
String
contentKey
=
SetLongMemoryConstants
.
REDIS_PREFIX
+
agentId
+
":"
+
BlContext
.
getCurrentUserNotException
().
getUserId
().
toString
();
String
key
=
agentId
+
":"
+
agentId
;
String
contentKey
=
SetLongMemoryConstants
.
REDIS_PREFIX
+
key
+
":"
+
BlContext
.
getCurrentUserNotException
().
getUserId
().
toString
();
redisService
.
hdel
(
contentKey
,
timestamp
);
redisService
.
hdel
(
contentKey
,
timestamp
);
}
}
@Override
@Override
public
void
deleteLongMemory
(
String
agentId
)
{
public
void
deleteLongMemory
(
String
agentId
)
{
Assert
.
notNull
(
agentId
);
Assert
.
notNull
(
agentId
);
String
contentKey
=
SetLongMemoryConstants
.
REDIS_PREFIX
+
agentId
+
":"
+
BlContext
.
getCurrentUserNotException
().
getUserId
().
toString
();
String
key
=
agentId
+
":"
+
agentId
;
String
contentKey
=
SetLongMemoryConstants
.
REDIS_PREFIX
+
key
+
":"
+
BlContext
.
getCurrentUserNotException
().
getUserId
().
toString
();
redisService
.
del
(
contentKey
);
redisService
.
del
(
contentKey
);
}
}
}
}
\ No newline at end of file
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