You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.6 KiB
Java
60 lines
1.6 KiB
Java
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 conversationId;
|
|
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.getAnswerMap())){
|
|
this.answwerMap = JSONUtil.toBean(conversationQa.getAnswerMap(), Map.class);
|
|
}
|
|
this.setType(conversationQa.getType());
|
|
this.setQuestionTime(conversationQa.getQuestionTime());
|
|
this.setIntentType(conversationQa.getIntentType());
|
|
}
|
|
}
|