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
f4a7df26
Commit
f4a7df26
authored
Mar 12, 2025
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 问答知识库 新增/更新分片内容,字数校验
parent
89e169cb
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
7 deletions
+7
-7
KnowledgeServiceImpl.java
...om/poc/knowledge/aggregate/impl/KnowledgeServiceImpl.java
+2
-2
QAKnowledgeServiceImpl.java
.../poc/knowledge/aggregate/impl/QAKnowledgeServiceImpl.java
+2
-2
exception.properties
...in/resources/framemax-config/i18n/en/exception.properties
+1
-1
exception.properties
...resources/framemax-config/i18n/zh_cn/exception.properties
+1
-1
exception.properties
...resources/framemax-config/i18n/zh_tw/exception.properties
+1
-1
No files found.
src/main/java/cn/com/poc/knowledge/aggregate/impl/KnowledgeServiceImpl.java
View file @
f4a7df26
...
@@ -442,8 +442,8 @@ public class KnowledgeServiceImpl implements KnowledgeService {
...
@@ -442,8 +442,8 @@ public class KnowledgeServiceImpl implements KnowledgeService {
while
(
cellIterator
.
hasNext
())
{
while
(
cellIterator
.
hasNext
())
{
Cell
next
=
cellIterator
.
next
();
Cell
next
=
cellIterator
.
next
();
if
(
StringUtils
.
isNotBlank
(
next
.
toString
()))
{
if
(
StringUtils
.
isNotBlank
(
next
.
toString
()))
{
if
(
next
.
toString
().
length
()
>
3
00
)
{
// 每格字数不可超1000字
if
(
next
.
toString
().
length
()
>
7
00
)
{
// 每格字数不可超1000字
throw
new
I18nMessageException
(
"exception/file.cell.content.more.than.
3
00"
);
throw
new
I18nMessageException
(
"exception/file.cell.content.more.than.
7
00"
);
}
}
totalWordCount
+=
next
.
toString
().
length
();
totalWordCount
+=
next
.
toString
().
length
();
}
}
...
...
src/main/java/cn/com/poc/knowledge/aggregate/impl/QAKnowledgeServiceImpl.java
View file @
f4a7df26
...
@@ -111,8 +111,8 @@ public class QAKnowledgeServiceImpl implements QAKnowledgeService {
...
@@ -111,8 +111,8 @@ public class QAKnowledgeServiceImpl implements QAKnowledgeService {
int
totalWordCount
=
0
;
int
totalWordCount
=
0
;
for
(
ChunkInfo
chunkInfo
:
chunkInfos
)
{
for
(
ChunkInfo
chunkInfo
:
chunkInfos
)
{
totalWordCount
+=
chunkInfo
.
getContent
().
length
();
totalWordCount
+=
chunkInfo
.
getContent
().
length
();
if
(
chunkInfo
.
getContent
().
length
()
>
3
00
)
{
if
(
chunkInfo
.
getContent
().
length
()
>
7
00
)
{
throw
new
I18nMessageException
(
"exception/file.cell.content.more.than.
3
00"
);
throw
new
I18nMessageException
(
"exception/file.cell.content.more.than.
7
00"
);
}
}
if
(
totalWordCount
>
3000
)
{
if
(
totalWordCount
>
3000
)
{
throw
new
I18nMessageException
(
"exception/file.rows.content.more.than.3000"
);
throw
new
I18nMessageException
(
"exception/file.rows.content.more.than.3000"
);
...
...
src/main/resources/framemax-config/i18n/en/exception.properties
View file @
f4a7df26
...
@@ -84,5 +84,5 @@ create.num.limit=Creating has reached its maximum limit
...
@@ -84,5 +84,5 @@ create.num.limit=Creating has reached its maximum limit
qa.knowledge.document.struct.not.consistent
=
Inconsistent question and answer structure
qa.knowledge.document.struct.not.consistent
=
Inconsistent question and answer structure
file.rows.more.than.1500
=
The document exceeds 1500 lines
file.rows.more.than.1500
=
The document exceeds 1500 lines
file.columns.more.than.10
=
The document exceeds 10 columns
file.columns.more.than.10
=
The document exceeds 10 columns
file.cell.content.more.than.
300
=
Cell exceeds 3
00 characters
file.cell.content.more.than.
700
=
Cell exceeds 7
00 characters
file.rows.content.more.than.3000
=
The document line exceeds 3000 characters
file.rows.content.more.than.3000
=
The document line exceeds 3000 characters
\ No newline at end of file
src/main/resources/framemax-config/i18n/zh_cn/exception.properties
View file @
f4a7df26
...
@@ -84,5 +84,5 @@ create.num.limit=\u521B\u5EFA\u5DF2\u8FBE\u6700\u5927\u4E0A\u9650
...
@@ -84,5 +84,5 @@ create.num.limit=\u521B\u5EFA\u5DF2\u8FBE\u6700\u5927\u4E0A\u9650
qa.knowledge.document.struct.not.consistent
=
文档结构不一致
qa.knowledge.document.struct.not.consistent
=
文档结构不一致
file.rows.more.than.1500
=
文档超出1500行
file.rows.more.than.1500
=
文档超出1500行
file.columns.more.than.10
=
文档超出10列
file.columns.more.than.10
=
文档超出10列
file.cell.content.more.than.
300
=
单元格超出3
00字符数
file.cell.content.more.than.
700
=
单元格超出7
00字符数
file.rows.content.more.than.3000
=
文档行超出3000字符数
file.rows.content.more.than.3000
=
文档行超出3000字符数
\ No newline at end of file
src/main/resources/framemax-config/i18n/zh_tw/exception.properties
View file @
f4a7df26
...
@@ -84,5 +84,5 @@ create.num.limit=\u5275\u5EFA\u5DF2\u9054\u6700\u5927\u4E0A\u9650
...
@@ -84,5 +84,5 @@ create.num.limit=\u5275\u5EFA\u5DF2\u9054\u6700\u5927\u4E0A\u9650
qa.knowledge.document.struct.not.consistent
=
文檔結構不一致
qa.knowledge.document.struct.not.consistent
=
文檔結構不一致
file.rows.more.than.1500
=
文檔超出1500行
file.rows.more.than.1500
=
文檔超出1500行
file.columns.more.than.10
=
文檔超出10列
file.columns.more.than.10
=
文檔超出10列
file.cell.content.more.than.
300
=
單元格超出3
00字符數
file.cell.content.more.than.
700
=
單元格超出7
00字符數
file.rows.content.more.than.3000
=
文檔超出3000字符數
file.rows.content.more.than.3000
=
文檔超出3000字符數
\ 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