|
|
@@ -13,6 +13,7 @@ import cn.iocoder.yudao.module.infra.service.file.FileService;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
import io.swagger.v3.oas.annotations.Parameters;
|
|
|
+import io.swagger.v3.oas.annotations.media.Schema;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import jakarta.annotation.Resource;
|
|
|
import jakarta.annotation.security.PermitAll;
|
|
|
@@ -44,6 +45,8 @@ public class FileController {
|
|
|
|
|
|
@PostMapping("/upload")
|
|
|
@Operation(summary = "上传文件", description = "模式一:后端上传文件")
|
|
|
+ @Parameter(name = "file", description = "文件附件", required = true,
|
|
|
+ schema = @Schema(type = "string", format = "binary"))
|
|
|
public CommonResult<String> uploadFile(@Valid FileUploadReqVO uploadReqVO) throws Exception {
|
|
|
MultipartFile file = uploadReqVO.getFile();
|
|
|
byte[] content = IoUtil.readBytes(file.getInputStream());
|