文件上传下载修正
This commit is contained in:
@@ -6,8 +6,10 @@ import java.util.Map;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.xyzh.api.ai.dto.TbKnowledge;
|
||||
import org.xyzh.api.ai.dto.TbKnowledgeFile;
|
||||
import org.xyzh.api.ai.vo.KnowledgeFileVO;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.core.page.PageParam;
|
||||
import org.xyzh.common.core.page.PageRequest;
|
||||
|
||||
public interface KnowledgeService {
|
||||
|
||||
@@ -107,15 +109,13 @@ public interface KnowledgeService {
|
||||
// ================================= 文件管理 =================================
|
||||
|
||||
/**
|
||||
* @description 获取知识库文档列表(从Dify获取)
|
||||
* @param knowledgeId 知识库ID
|
||||
* @param page 页码(从1开始)
|
||||
* @param limit 每页数量
|
||||
* @return ResultDomain<Map<String, Object>> 文档列表
|
||||
* @description 获取知识库文档列表(查询本地数据库,关联文件详细信息)
|
||||
* @param pageRequest 分页请求,filter 中包含 knowledgeId
|
||||
* @return ResultDomain<KnowledgeFileVO> 文档列表(含文件详细信息)
|
||||
* @author yslg
|
||||
* @since 2025-12-18
|
||||
* @since 2025-12-20
|
||||
*/
|
||||
ResultDomain<Map<String, Object>> getDocumentList(String knowledgeId, Integer page, Integer limit);
|
||||
ResultDomain<KnowledgeFileVO> getDocumentList(PageRequest<TbKnowledgeFile> pageRequest);
|
||||
|
||||
/**
|
||||
* @description 上传文件到知识库(完整流程:minio + Dify + 数据库)
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package org.xyzh.api.ai.vo;
|
||||
|
||||
import org.xyzh.api.ai.dto.TbKnowledgeFile;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @description 知识库文件视图对象(关联文件信息)
|
||||
* @filename KnowledgeFileVO.java
|
||||
* @author yslg
|
||||
* @copyright xyzh
|
||||
* @since 2025-12-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "知识库文件视图对象")
|
||||
public class KnowledgeFileVO extends BaseVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
// TbKnowledgeFile 的字段
|
||||
@Schema(description = "知识库ID")
|
||||
private String knowledgeId;
|
||||
|
||||
@Schema(description = "文件ID")
|
||||
private String fileId;
|
||||
|
||||
@Schema(description = "文件根ID")
|
||||
private String fileRootId;
|
||||
|
||||
@Schema(description = "Dify文件ID")
|
||||
private String difyFileId;
|
||||
|
||||
@Schema(description = "文件版本")
|
||||
private Integer version;
|
||||
|
||||
// TbSysFile 的字段
|
||||
@Schema(description = "文件名")
|
||||
private String fileName;
|
||||
|
||||
@Schema(description = "文件路径")
|
||||
private String filePath;
|
||||
|
||||
@Schema(description = "文件大小(字节)")
|
||||
private Long fileSize;
|
||||
|
||||
@Schema(description = "文件MIME类型")
|
||||
private String fileMimeType;
|
||||
|
||||
@Schema(description = "文件访问URL")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "文件扩展名")
|
||||
private String fileExtension;
|
||||
|
||||
@Schema(description = "文件MD5值")
|
||||
private String fileMd5Hash;
|
||||
}
|
||||
Reference in New Issue
Block a user