/**
 * @ProjectName: 智慧评标-主观分助手
 * @Package: com.zhpb.gdyd_zhpb_zgf.dto
 * @ClassName: QaResponse
 * @Description: 智能问答响应DTO
 * @Author: 张志锋
 * @Date: 2025-11-03
 * @Version: 1.0
 * @Copyright: © 2025 智慧评标-主观分助手
 */
package com.zhpb.gdyd_zhpb_zgf.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

/**
 * 智能问答响应DTO
 */
@Data
@Schema(description = "智能问答响应")
public class QaResponse {

    @Schema(description = "响应状态码，0表示成功", example = "0")
    private Integer code;

    @Schema(description = "响应消息", example = "查询成功")
    private String message;

    @Schema(description = "响应数据")
    private QaData data;

    @Data
    @Schema(description = "智能问答响应数据")
    public static class QaData {

        @Schema(description = "会话ID", example = "session-001")
        private String sessionId;

        @Schema(description = "消息ID", example = "msg-001")
        private String messageId;

        @Schema(description = "AI回答内容", example = "根据项目文档显示，这个项目的总预算为500万元人民币。")
        private String answer;

        @Schema(description = "答案来源信息")
        private List<SourceInfo> sources;
    }

    @Data
    @Schema(description = "答案来源信息")
    public static class SourceInfo {

        @Schema(description = "文件ID", example = "file-001")
        private String fileId;

        @Schema(description = "文件名", example = "技术方案.pdf")
        private String fileName;

        @Schema(description = "供应商名称", example = "彩讯科技股份有限公司")
        private String vendorName;

        @Schema(description = "页码", example = "5")
        private Integer page;

        @Schema(description = "章节", example = "第3章 项目预算")
        private String chapter;

        @Schema(description = "内容片段", example = "项目总预算为500万元，其中包含...")
        private String snippet;

        @Schema(description = "相似度", example = "0.85")
        private Double similarity;
    }
}
