|
@ -2,6 +2,7 @@ package com.digiwin.athena.app.chatFile.service.chatFile; |
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.TypeReference; |
|
|
import com.alibaba.fastjson.TypeReference; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
|
import com.digiwin.app.container.exceptions.DWBusinessException; |
|
|
import com.digiwin.app.service.DWEAIResult; |
|
|
import com.digiwin.app.service.DWEAIResult; |
|
|
import com.digiwin.athena.app.chatFile.infra.entity.ChatFileEntity; |
|
|
import com.digiwin.athena.app.chatFile.infra.entity.ChatFileEntity; |
|
|
import com.digiwin.athena.app.chatFile.infra.service.ChatFileService; |
|
|
import com.digiwin.athena.app.chatFile.infra.service.ChatFileService; |
|
@ -15,6 +16,7 @@ import javax.annotation.Resource; |
|
|
import java.util.HashMap; |
|
|
import java.util.HashMap; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Map; |
|
|
import java.util.Map; |
|
|
|
|
|
import java.util.Objects; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -38,16 +40,15 @@ public class ChatFileGetEAIService extends AbsEAIService { |
|
|
public DWEAIResult execute(Map<String, String> headers, String messageBody) throws Exception { |
|
|
public DWEAIResult execute(Map<String, String> headers, String messageBody) throws Exception { |
|
|
|
|
|
|
|
|
EAIRequest eaiRequest = EAIRequest.build(messageBody); |
|
|
EAIRequest eaiRequest = EAIRequest.build(messageBody); |
|
|
List<ChatFileEntity> chatFileInfo = eaiRequest.getObject("chat_file_info", new TypeReference<List<ChatFileEntity>>(){}); |
|
|
|
|
|
|
|
|
ChatFileEntity chatFileInfo = eaiRequest.getObject("chat_file_info", new TypeReference<ChatFileEntity>(){}); |
|
|
|
|
|
|
|
|
if (CollectionUtils.isEmpty(chatFileInfo)){ |
|
|
|
|
|
return buildOK(new HashMap<>()); |
|
|
|
|
|
|
|
|
if (Objects.isNull(chatFileInfo)){ |
|
|
|
|
|
throw new DWBusinessException("缺少必要参数chat_file_info"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
List<Long> idList = chatFileInfo.stream().map(ChatFileEntity::getId).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<ChatFileEntity> lmq = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<ChatFileEntity> lmq = new LambdaQueryWrapper<>(); |
|
|
lmq.in(ChatFileEntity::getId,idList); |
|
|
|
|
|
|
|
|
lmq.eq(ChatFileEntity::getId,chatFileInfo.getId()); |
|
|
List<ChatFileEntity> list = chatFileService.list(lmq); |
|
|
List<ChatFileEntity> list = chatFileService.list(lmq); |
|
|
|
|
|
|
|
|
return buildOK("chat_file_info",list); |
|
|
return buildOK("chat_file_info",list); |
|
|