Merge remote-tracking branch 'base-version/main' into dev

This commit is contained in:
chenbowen
2025-09-26 12:58:31 +08:00
6 changed files with 120 additions and 20 deletions

View File

@@ -10,10 +10,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.*;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@Tag(name = "RPC 服务 - 文件")
@@ -25,6 +22,16 @@ public interface FileApi {
@Operation(summary = "保存文件,并返回文件的访问路径")
CommonResult<String> createFile(@Valid @RequestBody FileCreateReqDTO createReqDTO);
/**
* 创建文件并返回完整文件信息
*
* @param createReqDTO 文件创建请求
* @return 文件完整信息
*/
@PostMapping(PREFIX + "/create-with-return")
@Operation(summary = "创建文件并返回完整文件信息")
CommonResult<FileRespDTO> createFileWithReturn(@Valid @RequestBody FileCreateReqDTO createReqDTO);
/**
* 根据文件编号获取文件信息和二进制内容
*
@@ -36,4 +43,15 @@ public interface FileApi {
CommonResult<FileRespDTO> getFile(@Parameter(description = "文件编号", required = true, example = "1024")
@RequestParam("fileId") @NotNull(message = "文件编号不能为空") Long fileId);
/**
* 删除文件
*
* @param fileId 文件编号
* @return 删除结果
*/
@DeleteMapping(PREFIX + "/delete")
@Operation(summary = "删除文件")
CommonResult<Boolean> deleteFile(@Parameter(description = "文件编号", required = true, example = "1024")
@RequestParam("fileId") @NotNull(message = "文件编号不能为空") Long fileId);
}