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
a8f6cd98
Commit
a8f6cd98
authored
Mar 12, 2025
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 文档知识库 分片操作限流
parent
dcba0d19
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
QAKnowledgeRestImpl.java
...a/cn/com/poc/knowledge/rest/impl/QAKnowledgeRestImpl.java
+8
-0
No files found.
src/main/java/cn/com/poc/knowledge/rest/impl/QAKnowledgeRestImpl.java
View file @
a8f6cd98
package
cn
.
com
.
poc
.
knowledge
.
rest
.
impl
;
import
cn.com.poc.common.annotation.RedisLimit
;
import
cn.com.poc.knowledge.aggregate.QAKnowledgeService
;
import
cn.com.poc.knowledge.convert.QAKnowledgeChunkConvert
;
import
cn.com.poc.knowledge.dto.QAKnowledgeChunkDto
;
...
...
@@ -26,21 +27,25 @@ public class QAKnowledgeRestImpl implements QAKnowledgeRest {
private
QAKnowledgeService
qaKnowledgeService
;
@Override
@RedisLimit
(
key
=
"OPEN_KNOWLEDGE_CHUNK"
,
timeout
=
1
,
currentUser
=
true
,
count
=
1
)
public
void
openKnowledgeChunk
(
UpsertChunkInfoDto
dto
)
{
qaKnowledgeService
.
openKnowledgeChunk
(
dto
.
getKdId
(),
dto
.
getChunkRelationId
(),
dto
.
getIsOpen
());
}
@Override
@RedisLimit
(
key
=
"DELETE_KNOWLEDGE_CHUNK"
,
timeout
=
1
,
currentUser
=
true
,
count
=
1
)
public
void
deleteKnowledgeChunk
(
UpsertChunkInfoDto
dto
)
{
qaKnowledgeService
.
deleteKnowledgeChunk
(
dto
.
getKdId
(),
dto
.
getChunkRelationId
());
}
@Override
@RedisLimit
(
key
=
"UPDATE_KNOWLEDGE_CHUNK_DOC"
,
timeout
=
1
,
currentUser
=
true
,
count
=
1
)
public
void
updateKnowledgeChunkDoc
(
UpsertChunkInfoDto
dto
)
{
qaKnowledgeService
.
updateKnowledgeChunkDoc
(
dto
.
getKdId
(),
dto
.
getChunkRelationId
(),
dto
.
getStructId
(),
dto
.
getChunkContent
());
}
@Override
@RedisLimit
(
key
=
"BATCH_UPDATE_KNOWLEDGE_CHUNK_DOC"
,
timeout
=
1
,
currentUser
=
true
,
count
=
1
)
public
void
batchUpdateKnowledgeChunkDoc
(
UpsertChunkInfoDto
dto
)
{
qaKnowledgeService
.
updateKnowledgeChunkDoc
(
dto
.
getKdId
(),
dto
.
getChunkRelationId
(),
dto
.
getChunkInfos
());
}
...
...
@@ -56,11 +61,13 @@ public class QAKnowledgeRestImpl implements QAKnowledgeRest {
}
@Override
@RedisLimit
(
key
=
"UPDATE_KNOWLEDGE_CHUNK"
,
timeout
=
1
,
currentUser
=
true
,
count
=
1
)
public
void
updateKnowledgeChunk
(
Integer
kdId
,
Long
structId
,
String
structName
,
String
isIndex
)
{
qaKnowledgeService
.
updateKnowledgeStruct
(
kdId
,
structId
,
structName
,
isIndex
);
}
@Override
@RedisLimit
(
key
=
"OPEN_KNOWLEDGE_CHUNK"
,
timeout
=
1
,
currentUser
=
true
,
count
=
1
)
public
void
batchDeleteKnowledgeChunks
(
Integer
kdId
,
List
<
String
>
chunkRelationIds
)
{
for
(
String
chunkRelationId
:
chunkRelationIds
)
{
qaKnowledgeService
.
deleteKnowledgeChunk
(
kdId
,
chunkRelationId
);
...
...
@@ -68,6 +75,7 @@ public class QAKnowledgeRestImpl implements QAKnowledgeRest {
}
@Override
@RedisLimit
(
key
=
"OPEN_KNOWLEDGE_CHUNK"
,
timeout
=
1
,
currentUser
=
true
,
count
=
1
)
public
void
updateChunkSort
(
Integer
kdId
,
String
chunkRelationId
,
Integer
sort
)
{
qaKnowledgeService
.
updateKnowledgeChunkSort
(
kdId
,
chunkRelationId
,
sort
);
}
...
...
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