Commit 65b8fd9b authored by alex yao's avatar alex yao

feat:获取知识库列表添加文档详情字段

parent 72075138
...@@ -20,6 +20,7 @@ import cn.com.poc.common.constant.CommonConstant; ...@@ -20,6 +20,7 @@ import cn.com.poc.common.constant.CommonConstant;
import cn.com.poc.common.constant.XLangConstant; import cn.com.poc.common.constant.XLangConstant;
import cn.com.poc.common.utils.StringUtils; import cn.com.poc.common.utils.StringUtils;
import cn.com.yict.framemax.core.exception.BusinessException; import cn.com.yict.framemax.core.exception.BusinessException;
import cn.com.yict.framemax.core.i18n.I18nMessageException;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import cn.com.poc.agent_application.rest.BizAgentApplicationMallRest; import cn.com.poc.agent_application.rest.BizAgentApplicationMallRest;
import cn.com.poc.agent_application.service.BizAgentApplicationMallService; import cn.com.poc.agent_application.service.BizAgentApplicationMallService;
...@@ -172,6 +173,8 @@ public class BizAgentApplicationMallRestImpl implements BizAgentApplicationMallR ...@@ -172,6 +173,8 @@ public class BizAgentApplicationMallRestImpl implements BizAgentApplicationMallR
case XLangConstant.ZH_TW: case XLangConstant.ZH_TW:
result.add(entity.getCategoryTw()); result.add(entity.getCategoryTw());
break; break;
default:
throw new I18nMessageException("不支持的语言");
} }
} }
return result; return result;
......
...@@ -2,6 +2,7 @@ package cn.com.poc.knowledge.convert; ...@@ -2,6 +2,7 @@ package cn.com.poc.knowledge.convert;
import cn.com.poc.common.utils.JsonUtils; import cn.com.poc.common.utils.JsonUtils;
import cn.com.poc.common.utils.StringUtils; 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.entity.BizKnowledgeDocumentEntity;
import cn.com.poc.knowledge.model.BizKnowledgeDocumentModel; import cn.com.poc.knowledge.model.BizKnowledgeDocumentModel;
import cn.com.poc.thirdparty.resource.demand.ai.entity.knowledge.SegmentationConfigRequest; import cn.com.poc.thirdparty.resource.demand.ai.entity.knowledge.SegmentationConfigRequest;
...@@ -58,4 +59,20 @@ public class KnowledgeDocumentConvert { ...@@ -58,4 +59,20 @@ public class KnowledgeDocumentConvert {
return bizKnowledgeDocumentModel; 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;
}
} }
...@@ -5,13 +5,13 @@ import java.util.List; ...@@ -5,13 +5,13 @@ import java.util.List;
public class QueryKnowledgeDocumentDto extends BizKnowledgeInfoDto { public class QueryKnowledgeDocumentDto extends BizKnowledgeInfoDto {
private List<String> documentNames; private List<BizKnowledgeDocumentDto> documentInfos;
public List<String> getDocumentNames() { public List<BizKnowledgeDocumentDto> getDocumentInfos() {
return documentNames; return documentInfos;
} }
public void setDocumentNames(List<String> documentNames) { public void setDocumentInfos(List<BizKnowledgeDocumentDto> documentInfos) {
this.documentNames = documentNames; this.documentInfos = documentInfos;
} }
} }
...@@ -7,6 +7,7 @@ import cn.com.poc.common.utils.JsonUtils; ...@@ -7,6 +7,7 @@ import cn.com.poc.common.utils.JsonUtils;
import cn.com.poc.knowledge.aggregate.KnowledgeService; import cn.com.poc.knowledge.aggregate.KnowledgeService;
import cn.com.poc.knowledge.constant.KnowledgeConstant; import cn.com.poc.knowledge.constant.KnowledgeConstant;
import cn.com.poc.knowledge.convert.BizKnowledgeInfoConvert; 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.dto.*;
import cn.com.poc.knowledge.entity.BizKnowledgeDocumentEntity; import cn.com.poc.knowledge.entity.BizKnowledgeDocumentEntity;
import cn.com.poc.knowledge.entity.BizKnowledgeInfoEntity; import cn.com.poc.knowledge.entity.BizKnowledgeInfoEntity;
...@@ -203,8 +204,9 @@ public class KnowledgeRestImpl implements KnowledgeRest { ...@@ -203,8 +204,9 @@ public class KnowledgeRestImpl implements KnowledgeRest {
}.getType()); }.getType());
if (CollectionUtils.isNotEmpty(kdIdList)) { if (CollectionUtils.isNotEmpty(kdIdList)) {
List<BizKnowledgeDocumentEntity> entities = knowledgeService.getListByKdIds(kdIdList); List<BizKnowledgeDocumentEntity> entities = knowledgeService.getListByKdIds(kdIdList);
List<String> documentNames = entities.stream().map(BizKnowledgeDocumentEntity::getDocumentName).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(entities)) {
dto.setDocumentNames(documentNames); dto.setDocumentInfos(entities.stream().map(KnowledgeDocumentConvert::entityToDto).collect(Collectors.toList()));
}
} }
return dto; return dto;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
......
...@@ -70,4 +70,7 @@ tencent.speech.synthesizer.secretKey=4yg9kIdpoptnmP9nFUaadnt32QEqEOOB ...@@ -70,4 +70,7 @@ tencent.speech.synthesizer.secretKey=4yg9kIdpoptnmP9nFUaadnt32QEqEOOB
#email send #email send
project.name="poc-api" project.name="poc-api"
\ No newline at end of file
#18n
i18n.disable = false
\ 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