feat(phase1): 完成分层结构优化和 DTO 创建
Task 4.2: 分层结构优化 - 创建 exception 包 - SessionNotFoundException: 会话未找到异常 - DocumentProcessException: 文档处理异常 - 已有分层结构验证 - controller: 控制器层 ✅ - service: 业务逻辑层 ✅ - repository: 数据访问层 ✅ - domain: 领域模型层 (entity/model/enums) ✅ - config: 配置层 ✅ - tool: 工具类 ✅ Task 4.3: 创建 DTO 类 - DiagnosisRequest: 诊断请求 DTO (10 个字段) - DiagnosisResponse: 诊断响应 DTO (12 个字段 + 内部类) - DocumentUploadRequest: 文档上传请求 DTO (7 个字段) - DocumentQueryResponse: 文档查询响应 DTO (11 个字段 + 内部类) - Result<T>: 统一响应结果 DTO (泛型包装) 功能特性: - 异常类支持自定义错误信息和原因链 - DTO 使用 Lombok 简化代码 - Result 提供静态工厂方法(success/error) - DocumentUploadRequest 支持 MultipartFile - Response DTO 支持嵌套数据结构 编译验证:BUILD SUCCESS Progress: 23/33 tasks completed (70%)
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
package com.superbiz.agent.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 诊断响应 DTO
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DiagnosisResponse {
|
||||
|
||||
/**
|
||||
* 诊断ID
|
||||
*/
|
||||
private String diagnosisId;
|
||||
|
||||
/**
|
||||
* 会话ID
|
||||
*/
|
||||
private String sessionId;
|
||||
|
||||
/**
|
||||
* 诊断状态(PENDING/RUNNING/SUCCESS/FAILED)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 问题类型
|
||||
*/
|
||||
private String problemType;
|
||||
|
||||
/**
|
||||
* 根因分析
|
||||
*/
|
||||
private String rootCause;
|
||||
|
||||
/**
|
||||
* 修复方案
|
||||
*/
|
||||
private String solution;
|
||||
|
||||
/**
|
||||
* 完整诊断报告(Markdown格式)
|
||||
*/
|
||||
private String reportMarkdown;
|
||||
|
||||
/**
|
||||
* 诊断置信度(0-100)
|
||||
*/
|
||||
private Integer confidence;
|
||||
|
||||
/**
|
||||
* 诊断耗时(毫秒)
|
||||
*/
|
||||
private Integer duration;
|
||||
|
||||
/**
|
||||
* 工具调用记录
|
||||
*/
|
||||
private List<Map<String, Object>> toolCalls;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
/**
|
||||
* 相似案例推荐
|
||||
*/
|
||||
private List<RecommendedCase> recommendedCases;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class RecommendedCase {
|
||||
private String caseId;
|
||||
private String title;
|
||||
private String rootCause;
|
||||
private String solution;
|
||||
private Double similarity;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user