Browse Source

fix:chatfile新增时获取的数据改为数组

master
郑贵龙 1 year ago
parent
commit
049713a0ee
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileCreateEAIService.java

+ 2
- 3
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileCreateEAIService.java View File

@ -1,8 +1,6 @@
package com.digiwin.athena.app.chatFile.service.chatFile;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.nacos.common.utils.CollectionUtils;
import com.alibaba.nacos.common.utils.StringUtils;
import com.digiwin.app.container.exceptions.DWBusinessException;
import com.digiwin.app.service.DWEAIResult;
import com.digiwin.athena.app.chatFile.infra.entity.ChatFileEntity;
@ -37,7 +35,8 @@ public class ChatFileCreateEAIService extends AbsEAIService {
@Override
public DWEAIResult execute(Map<String, String> headers, String messageBody) throws Exception {
EAIRequest eaiRequest = EAIRequest.build(messageBody);
ChatFileEntity chatFileInfo = eaiRequest.getObject("chat_file_info", new TypeReference<ChatFileEntity>(){});
List<ChatFileEntity> chatFileInfoList = eaiRequest.getObject("chat_file_info", new TypeReference<List<ChatFileEntity>>(){});
ChatFileEntity chatFileInfo = chatFileInfoList.get(0);
if (Objects.isNull(chatFileInfo)){
throw new DWBusinessException("缺少必要参数chat_file_info");


Loading…
Cancel
Save