部分dto、vo

This commit is contained in:
2025-12-05 11:05:27 +08:00
parent 9a3547b70b
commit 917e9a517a
42 changed files with 2803 additions and 67 deletions

View File

@@ -0,0 +1,9 @@
package org.xyzh.api.agent;
/**
* Agent服务接口
* 用于知识库和文档管理
*/
public interface AgentService {
}

View File

@@ -0,0 +1,51 @@
package org.xyzh.api.agent.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.xyzh.common.dto.BaseDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import com.fasterxml.jackson.databind.JsonNode;
/**
* 知识库DTO
* 用于创建和更新知识库
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "知识库DTO")
public class KnowledgeBaseDTO extends BaseDTO {
private static final long serialVersionUID = 1L;
@Schema(description = "知识库ID更新时需要")
private String knowledgeId;
@Schema(description = "智能体ID")
private String agentId;
@Schema(description = "知识库名称")
private String name;
@Schema(description = "知识库类型bidding-招投标/customer_service-客服/internal-内部协同")
private String kbType;
@Schema(description = "访问级别public-公开/private-私有/internal-内部")
private String accessLevel;
@Schema(description = "知识库描述")
private String description;
@Schema(description = "存储路径")
private String storagePath;
@Schema(description = "当前版本号")
private String version;
@Schema(description = "知识库配置")
private JsonNode config;
@Schema(description = "服务类型")
private String serviceType;
@Schema(description = "状态active-激活/inactive-停用/archived-归档")
private String status;
}

View File

@@ -0,0 +1,48 @@
package org.xyzh.api.agent.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.xyzh.common.dto.BaseDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import com.fasterxml.jackson.databind.JsonNode;
/**
* 知识文档片段DTO
* 用于创建和更新知识文档片段
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "知识文档片段DTO")
public class KnowledgeChunkDTO extends BaseDTO {
private static final long serialVersionUID = 1L;
@Schema(description = "片段ID更新时需要")
private String chunkId;
@Schema(description = "所属文档ID")
private String docId;
@Schema(description = "所属知识库ID")
private String knowledgeId;
@Schema(description = "片段索引")
private Integer chunkIndex;
@Schema(description = "片段内容")
private String content;
@Schema(description = "片段类型text-文本/table-表格/image-图片")
private String chunkType;
@Schema(description = "根chunk ID")
private String rootChunkId;
@Schema(description = "是否当前版本", defaultValue = "true")
private Boolean isCurrent;
@Schema(description = "位置信息")
private JsonNode positionInfo;
@Schema(description = "片段元数据")
private JsonNode metadata;
}

View File

@@ -0,0 +1,67 @@
package org.xyzh.api.agent.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.xyzh.common.dto.BaseDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import com.fasterxml.jackson.databind.JsonNode;
import java.util.List;
/**
* 知识文档DTO
* 用于创建和更新知识文档
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "知识文档DTO")
public class KnowledgeDocumentDTO extends BaseDTO {
private static final long serialVersionUID = 1L;
@Schema(description = "文档ID更新时需要")
private String docId;
@Schema(description = "所属知识库ID")
private String knowledgeId;
@Schema(description = "文档标题")
private String title;
@Schema(description = "文档类型text-文本/pdf/word/excel/image/video")
private String docType;
@Schema(description = "文档分类")
private String category;
@Schema(description = "文档内容(文本类型)")
private String content;
@Schema(description = "关联文件ID")
private String fileId;
@Schema(description = "文件路径")
private String filePath;
@Schema(description = "文件大小")
private Long fileSize;
@Schema(description = "MIME类型")
private String mimeType;
@Schema(description = "根文档ID")
private String rootDocId;
@Schema(description = "文档标签")
private List<String> tags;
@Schema(description = "来源URL")
private String sourceUrl;
@Schema(description = "服务类型")
private String serviceType;
@Schema(description = "文档元数据")
private JsonNode metadata;
@Schema(description = "状态active-激活/inactive-停用/archived-归档")
private String status;
}

View File

@@ -0,0 +1,93 @@
package org.xyzh.api.agent.vo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.xyzh.common.vo.BaseVO;
import io.swagger.v3.oas.annotations.media.Schema;
import com.alibaba.fastjson2.annotation.JSONField;
import com.fasterxml.jackson.databind.JsonNode;
import java.util.Date;
/**
* 知识库VO
* 用于前端展示知识库信息
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "知识库VO")
public class KnowledgeBaseVO extends BaseVO {
private static final long serialVersionUID = 1L;
@Schema(description = "知识库ID")
private String knowledgeId;
@Schema(description = "智能体ID")
private String agentId;
@Schema(description = "智能体名称")
private String agentName;
@Schema(description = "知识库名称")
private String name;
@Schema(description = "知识库类型")
private String kbType;
@Schema(description = "知识库类型名称")
private String kbTypeName;
@Schema(description = "访问级别")
private String accessLevel;
@Schema(description = "访问级别名称")
private String accessLevelName;
@Schema(description = "知识库描述")
private String description;
@Schema(description = "存储路径")
private String storagePath;
@Schema(description = "当前版本号")
private String version;
@Schema(description = "知识库配置")
private JsonNode config;
@Schema(description = "服务类型")
private String serviceType;
@Schema(description = "部门名称")
private String deptName;
@Schema(description = "状态")
private String status;
@Schema(description = "状态名称")
private String statusName;
@Schema(description = "状态颜色")
private String statusColor;
@Schema(description = "文档总数")
private Long documentCount;
@Schema(description = "已向量化文档数")
private Long embeddedDocCount;
@Schema(description = "chunk总数")
private Long chunkCount;
@Schema(description = "总存储大小(字节)")
private Long totalSize;
@Schema(description = "总存储大小格式化显示")
private String totalSizeFormatted;
@Schema(description = "最后同步时间", format = "date-time")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date lastSyncTime;
@Schema(description = "创建者姓名")
private String creatorName;
}

View File

@@ -0,0 +1,68 @@
package org.xyzh.api.agent.vo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.xyzh.common.vo.BaseVO;
import io.swagger.v3.oas.annotations.media.Schema;
import com.alibaba.fastjson2.annotation.JSONField;
import com.fasterxml.jackson.databind.JsonNode;
import java.util.Date;
/**
* 知识文档片段VO
* 用于前端展示知识文档片段信息
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "知识文档片段VO")
public class KnowledgeChunkVO extends BaseVO {
private static final long serialVersionUID = 1L;
@Schema(description = "片段ID")
private String chunkId;
@Schema(description = "所属文档ID")
private String docId;
@Schema(description = "文档标题")
private String docTitle;
@Schema(description = "所属知识库ID")
private String knowledgeId;
@Schema(description = "知识库名称")
private String knowledgeName;
@Schema(description = "片段索引")
private Integer chunkIndex;
@Schema(description = "片段内容")
private String content;
@Schema(description = "内容长度")
private Integer contentLength;
@Schema(description = "片段类型")
private String chunkType;
@Schema(description = "片段类型名称")
private String chunkTypeName;
@Schema(description = "版本号")
private Integer version;
@Schema(description = "根chunk ID")
private String rootChunkId;
@Schema(description = "是否当前版本", defaultValue = "false")
private Boolean isCurrent;
@Schema(description = "位置信息")
private JsonNode positionInfo;
@Schema(description = "片段元数据")
private JsonNode metadata;
@Schema(description = "部门名称")
private String deptName;
}

View File

@@ -0,0 +1,114 @@
package org.xyzh.api.agent.vo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.xyzh.common.vo.BaseVO;
import io.swagger.v3.oas.annotations.media.Schema;
import com.alibaba.fastjson2.annotation.JSONField;
import com.fasterxml.jackson.databind.JsonNode;
import java.util.Date;
import java.util.List;
/**
* 知识文档VO
* 用于前端展示知识文档信息
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "知识文档VO")
public class KnowledgeDocumentVO extends BaseVO {
private static final long serialVersionUID = 1L;
@Schema(description = "文档ID")
private String docId;
@Schema(description = "所属知识库ID")
private String knowledgeId;
@Schema(description = "知识库名称")
private String knowledgeName;
@Schema(description = "文档标题")
private String title;
@Schema(description = "文档类型")
private String docType;
@Schema(description = "文档类型名称")
private String docTypeName;
@Schema(description = "文档分类")
private String category;
@Schema(description = "文档内容")
private String content;
@Schema(description = "内容摘要")
private String contentSummary;
@Schema(description = "关联文件ID")
private String fileId;
@Schema(description = "文件路径")
private String filePath;
@Schema(description = "文件下载URL")
private String fileUrl;
@Schema(description = "文件大小")
private Long fileSize;
@Schema(description = "文件大小格式化显示")
private String fileSizeFormatted;
@Schema(description = "MIME类型")
private String mimeType;
@Schema(description = "版本号")
private Integer version;
@Schema(description = "根文档ID")
private String rootDocId;
@Schema(description = "文档标签")
private List<String> tags;
@Schema(description = "关键词")
private List<String> keywords;
@Schema(description = "向量化状态")
private String embeddingStatus;
@Schema(description = "向量化状态名称")
private String embeddingStatusName;
@Schema(description = "使用的向量化模型")
private String embeddingModel;
@Schema(description = "切片数量")
private Integer chunkCount;
@Schema(description = "文档元数据")
private JsonNode metadata;
@Schema(description = "来源URL")
private String sourceUrl;
@Schema(description = "服务类型")
private String serviceType;
@Schema(description = "部门名称")
private String deptName;
@Schema(description = "状态")
private String status;
@Schema(description = "状态名称")
private String statusName;
@Schema(description = "创建者姓名")
private String creatorName;
@Schema(description = "更新者姓名")
private String updaterName;
}