temp
This commit is contained in:
22
urbanLifelineServ/apis/api-file/pom.xml
Normal file
22
urbanLifelineServ/apis/api-file/pom.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.xyzh</groupId>
|
||||
<artifactId>apis</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.xyzh.apis</groupId>
|
||||
<artifactId>api-file</artifactId>
|
||||
<version>${urban-lifeline.version}</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,49 @@
|
||||
package org.xyzh.api.file.dto;
|
||||
|
||||
import org.xyzh.common.dto.BaseDTO;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* @description 系统文件DTO
|
||||
* @filename TbSysFileDTO.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "系统文件DTO")
|
||||
public class TbSysFileDTO extends BaseDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "文件ID (主键)")
|
||||
private String fileId;
|
||||
|
||||
@Schema(description = "文件名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "文件路径")
|
||||
private String path;
|
||||
|
||||
@Schema(description = "文件大小(字节)")
|
||||
private Long size;
|
||||
|
||||
@Schema(description = "文件类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "存储类型")
|
||||
private String storageType;
|
||||
|
||||
@Schema(description = "MIME 类型")
|
||||
private String mimeType;
|
||||
|
||||
@Schema(description = "文件访问 URL")
|
||||
private String url;
|
||||
|
||||
@Schema(description = "文件状态")
|
||||
private String status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package org.xyzh.api.file.service;
|
||||
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.xyzh.api.file.dto.TbSysFileDTO;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
|
||||
/**
|
||||
* @description 文件服务接口
|
||||
* @filename FileService.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
public interface FileService {
|
||||
|
||||
/**
|
||||
* @description 上传文件
|
||||
* @param file 文件对象
|
||||
* @param module 所属模块
|
||||
* @param businessId 业务ID
|
||||
* @return ResultDomain<TbSysFile> 上传结果,包含文件信息
|
||||
* @author yslg
|
||||
* @since 2025-10-16
|
||||
*/
|
||||
ResultDomain<TbSysFileDTO> uploadFile(MultipartFile file, String module, String businessId);
|
||||
|
||||
/**
|
||||
* @description 批量上传文件
|
||||
* @param files 文件对象列表
|
||||
* @param module 所属模块
|
||||
* @param businessId 业务ID
|
||||
* @param uploader 上传者用户ID(可选)
|
||||
* @return ResultDomain<TbSysFile> 上传结果,包含文件信息列表
|
||||
* @author yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
ResultDomain<TbSysFileDTO> batchUploadFiles(MultipartFile[] files, String module, String businessId, String uploader);
|
||||
|
||||
/**
|
||||
* @description 删除文件
|
||||
* @param fileId 文件ID
|
||||
* @return ResultDomain<String> 删除结果
|
||||
* @author yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
ResultDomain<Boolean> deleteFile(String fileId);
|
||||
|
||||
/**
|
||||
* @description 批量删除文件(逻辑删除)
|
||||
* @param fileIds 文件ID列表
|
||||
* @return ResultDomain<TbSysFileDTO> 删除结果
|
||||
* @author yslg
|
||||
* @since 2025-10-16
|
||||
*/
|
||||
ResultDomain<TbSysFileDTO> batchDeleteFiles(String[] fileIds);
|
||||
|
||||
/**
|
||||
* @description 下载文件
|
||||
* @param fileId 文件ID
|
||||
* @return ResultDomain<byte[]> 文件字节数组
|
||||
* @author yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
ResultDomain<byte[]> downloadFile(String fileId);
|
||||
|
||||
/**
|
||||
* @description 根据文件ID查询文件信息
|
||||
* @param fileId 文件ID
|
||||
* @return ResultDomain<TbSysFile> 文件信息
|
||||
* @author yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
ResultDomain<TbSysFileDTO> getFileById(String fileId);
|
||||
|
||||
/**
|
||||
* @description 保存临时文件
|
||||
* @param file 文件对象
|
||||
* @param module 所属模块
|
||||
* @param businessId 业务ID
|
||||
* @return ResultDomain<TbSysFileDTO> 保存结果
|
||||
* @author yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
ResultDomain<TbSysFileDTO> saveTempFile(MultipartFile file, String module, String businessId);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user