|
|
|
package com.supervision.police.vo;
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
import com.supervision.chat.client.dto.chat.ChatResDTO;
|
|
|
|
import com.supervision.police.domain.ConversationQa;
|
|
|
|
import com.supervision.police.vo.dify.KnowledgeBaseSegmentVO;
|
|
|
|
import lombok.Data;
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
@Data
|
|
|
|
public class ChatResVO {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 问答id
|
|
|
|
*/
|
|
|
|
private String id;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 问题
|
|
|
|
*/
|
|
|
|
private String question;
|
|
|
|
|
|
|
|
private Date questionTime;
|
|
|
|
|
|
|
|
private String answer;
|
|
|
|
private Map<String, Object> answwerMap;
|
|
|
|
private String type;
|
|
|
|
private String intentType;
|
|
|
|
private List<String> docs;
|
|
|
|
private List<KnowledgeBaseSegmentVO> segmentVOList = new ArrayList<>();
|
|
|
|
|
|
|
|
public ChatResVO() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public ChatResVO(ChatResDTO chatResDTO) {
|
|
|
|
if (Objects.isNull(chatResDTO)){
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
this.answer = chatResDTO.getAnswer();
|
|
|
|
this.docs = chatResDTO.getDocs();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ChatResVO(ConversationQa conversationQa) {
|
|
|
|
if (null == conversationQa){
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
this.setId(conversationQa.getId());
|
|
|
|
this.setQuestion(conversationQa.getQuestion());
|
|
|
|
this.setAnswer(conversationQa.getAnswer());
|
|
|
|
if (StrUtil.isNotEmpty(conversationQa.getAnswer())){
|
|
|
|
this.answwerMap = JSONUtil.toBean(conversationQa.getAnswer(), Map.class);
|
|
|
|
}
|
|
|
|
this.setType(conversationQa.getType());
|
|
|
|
this.setQuestionTime(conversationQa.getQuestionTime());
|
|
|
|
this.setIntentType(conversationQa.getIntentType());
|
|
|
|
}
|
|
|
|
}
|