Commit f4a7df26 authored by alex yao's avatar alex yao

feat: 问答知识库 新增/更新分片内容,字数校验

parent 89e169cb
...@@ -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() > 300) { // 每格字数不可超1000字 if (next.toString().length() > 700) { // 每格字数不可超1000字
throw new I18nMessageException("exception/file.cell.content.more.than.300"); throw new I18nMessageException("exception/file.cell.content.more.than.700");
} }
totalWordCount += next.toString().length(); totalWordCount += next.toString().length();
} }
......
...@@ -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() > 300) { if (chunkInfo.getContent().length() > 700) {
throw new I18nMessageException("exception/file.cell.content.more.than.300"); throw new I18nMessageException("exception/file.cell.content.more.than.700");
} }
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");
......
...@@ -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 300 characters file.cell.content.more.than.700=Cell exceeds 700 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
...@@ -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=单元格超出300字符数 file.cell.content.more.than.700=单元格超出700字符数
file.rows.content.more.than.3000=文档行超出3000字符数 file.rows.content.more.than.3000=文档行超出3000字符数
\ No newline at end of file
...@@ -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=單元格超出300字符數 file.cell.content.more.than.700=單元格超出700字符數
file.rows.content.more.than.3000=文檔超出3000字符數 file.rows.content.more.than.3000=文檔超出3000字符數
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment