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
65b8fd9b
Commit
65b8fd9b
authored
Nov 05, 2024
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:获取知识库列表添加文档详情字段
parent
72075138
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
8 deletions
+33
-8
BizAgentApplicationMallRestImpl.java
...pplication/rest/impl/BizAgentApplicationMallRestImpl.java
+3
-0
KnowledgeDocumentConvert.java
...n/com/poc/knowledge/convert/KnowledgeDocumentConvert.java
+17
-0
QueryKnowledgeDocumentDto.java
...a/cn/com/poc/knowledge/dto/QueryKnowledgeDocumentDto.java
+5
-5
KnowledgeRestImpl.java
...ava/cn/com/poc/knowledge/rest/impl/KnowledgeRestImpl.java
+4
-2
config.properties
src/main/resources/framemax-config/config.properties
+4
-1
No files found.
src/main/java/cn/com/poc/agent_application/rest/impl/BizAgentApplicationMallRestImpl.java
View file @
65b8fd9b
...
...
@@ -20,6 +20,7 @@ import cn.com.poc.common.constant.CommonConstant;
import
cn.com.poc.common.constant.XLangConstant
;
import
cn.com.poc.common.utils.StringUtils
;
import
cn.com.yict.framemax.core.exception.BusinessException
;
import
cn.com.yict.framemax.core.i18n.I18nMessageException
;
import
org.springframework.stereotype.Component
;
import
cn.com.poc.agent_application.rest.BizAgentApplicationMallRest
;
import
cn.com.poc.agent_application.service.BizAgentApplicationMallService
;
...
...
@@ -172,6 +173,8 @@ public class BizAgentApplicationMallRestImpl implements BizAgentApplicationMallR
case
XLangConstant
.
ZH_TW
:
result
.
add
(
entity
.
getCategoryTw
());
break
;
default
:
throw
new
I18nMessageException
(
"不支持的语言"
);
}
}
return
result
;
...
...
src/main/java/cn/com/poc/knowledge/convert/KnowledgeDocumentConvert.java
View file @
65b8fd9b
...
...
@@ -2,6 +2,7 @@ package cn.com.poc.knowledge.convert;
import
cn.com.poc.common.utils.JsonUtils
;
import
cn.com.poc.common.utils.StringUtils
;
import
cn.com.poc.knowledge.dto.BizKnowledgeDocumentDto
;
import
cn.com.poc.knowledge.entity.BizKnowledgeDocumentEntity
;
import
cn.com.poc.knowledge.model.BizKnowledgeDocumentModel
;
import
cn.com.poc.thirdparty.resource.demand.ai.entity.knowledge.SegmentationConfigRequest
;
...
...
@@ -58,4 +59,20 @@ public class KnowledgeDocumentConvert {
return
bizKnowledgeDocumentModel
;
}
public
static
BizKnowledgeDocumentDto
entityToDto
(
BizKnowledgeDocumentEntity
entity
)
{
BizKnowledgeDocumentDto
bizKnowledgeDocumentDto
=
new
BizKnowledgeDocumentDto
();
bizKnowledgeDocumentDto
.
setKdId
(
entity
.
getKdId
());
bizKnowledgeDocumentDto
.
setOwner
(
entity
.
getOwner
());
bizKnowledgeDocumentDto
.
setKnowledgeType
(
entity
.
getKnowledgeType
());
bizKnowledgeDocumentDto
.
setDocumentName
(
entity
.
getDocumentName
());
bizKnowledgeDocumentDto
.
setDocumentUrl
(
entity
.
getDocumentUrl
());
bizKnowledgeDocumentDto
.
setDocumentSize
(
String
.
valueOf
(
entity
.
getDocumentSize
()));
bizKnowledgeDocumentDto
.
setCharCount
(
entity
.
getCharCount
());
bizKnowledgeDocumentDto
.
setUploadTime
(
entity
.
getUploadTime
());
bizKnowledgeDocumentDto
.
setIsEnable
(
entity
.
getIsEnable
());
bizKnowledgeDocumentDto
.
setKnowledgeId
(
entity
.
getKnowledgeId
());
bizKnowledgeDocumentDto
.
setTrainStatus
(
entity
.
getTrainStatus
());
bizKnowledgeDocumentDto
.
setSegmentationConfig
(
entity
.
getSegmentationConfig
());
return
bizKnowledgeDocumentDto
;
}
}
src/main/java/cn/com/poc/knowledge/dto/QueryKnowledgeDocumentDto.java
View file @
65b8fd9b
...
...
@@ -5,13 +5,13 @@ import java.util.List;
public
class
QueryKnowledgeDocumentDto
extends
BizKnowledgeInfoDto
{
private
List
<
String
>
documentName
s
;
private
List
<
BizKnowledgeDocumentDto
>
documentInfo
s
;
public
List
<
String
>
getDocumentName
s
()
{
return
document
Name
s
;
public
List
<
BizKnowledgeDocumentDto
>
getDocumentInfo
s
()
{
return
document
Info
s
;
}
public
void
setDocument
Names
(
List
<
String
>
documentName
s
)
{
this
.
document
Names
=
documentName
s
;
public
void
setDocument
Infos
(
List
<
BizKnowledgeDocumentDto
>
documentInfo
s
)
{
this
.
document
Infos
=
documentInfo
s
;
}
}
src/main/java/cn/com/poc/knowledge/rest/impl/KnowledgeRestImpl.java
View file @
65b8fd9b
...
...
@@ -7,6 +7,7 @@ import cn.com.poc.common.utils.JsonUtils;
import
cn.com.poc.knowledge.aggregate.KnowledgeService
;
import
cn.com.poc.knowledge.constant.KnowledgeConstant
;
import
cn.com.poc.knowledge.convert.BizKnowledgeInfoConvert
;
import
cn.com.poc.knowledge.convert.KnowledgeDocumentConvert
;
import
cn.com.poc.knowledge.dto.*
;
import
cn.com.poc.knowledge.entity.BizKnowledgeDocumentEntity
;
import
cn.com.poc.knowledge.entity.BizKnowledgeInfoEntity
;
...
...
@@ -203,8 +204,9 @@ public class KnowledgeRestImpl implements KnowledgeRest {
}.
getType
());
if
(
CollectionUtils
.
isNotEmpty
(
kdIdList
))
{
List
<
BizKnowledgeDocumentEntity
>
entities
=
knowledgeService
.
getListByKdIds
(
kdIdList
);
List
<
String
>
documentNames
=
entities
.
stream
().
map
(
BizKnowledgeDocumentEntity:
:
getDocumentName
).
collect
(
Collectors
.
toList
());
dto
.
setDocumentNames
(
documentNames
);
if
(
CollectionUtils
.
isNotEmpty
(
entities
))
{
dto
.
setDocumentInfos
(
entities
.
stream
().
map
(
KnowledgeDocumentConvert:
:
entityToDto
).
collect
(
Collectors
.
toList
()));
}
}
return
dto
;
}).
collect
(
Collectors
.
toList
());
...
...
src/main/resources/framemax-config/config.properties
View file @
65b8fd9b
...
...
@@ -70,4 +70,7 @@ tencent.speech.synthesizer.secretKey=4yg9kIdpoptnmP9nFUaadnt32QEqEOOB
#email send
project.name
=
"poc-api"
\ No newline at end of file
project.name
=
"poc-api"
#18n
i18n.disable
=
false
\ 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