From b66fda778edbe22dda737fc30c341f563fab8da4 Mon Sep 17 00:00:00 2001 From: lihanbo Date: Mon, 4 Nov 2024 15:32:23 +0800 Subject: [PATCH] =?UTF-8?q?105040=20=E8=B0=83=E6=95=B4=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/VersionManagementController.cs | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/LFlow.VersionManagement/Controller/VersionManagementController.cs b/LFlow.VersionManagement/Controller/VersionManagementController.cs index 0dbaae9..8f9b736 100644 --- a/LFlow.VersionManagement/Controller/VersionManagementController.cs +++ b/LFlow.VersionManagement/Controller/VersionManagementController.cs @@ -12,8 +12,8 @@ using SqlSugar; namespace LFlow.VersionManagement.Controller; public class VersionManagementController(IVersionManagementService service, IMinioClient _client) : BaseController { - - + + [HttpDelete] public int DeleteById(string id) @@ -64,17 +64,20 @@ public class VersionManagementController(IVersionManagementService service, IMin /// /// 保存文件 /// - /// - /// + /// /// - [HttpPost] - public async Task SaveFile(IFormFile formFile, bool isUpdate) + [HttpPost("upload")] + public async Task SaveFile(IFormFile formFile) { - + if (formFile == null || formFile.Length == 0) + { + return BadRequest("No file uploaded."); + } + MinIOService minIOService = new MinIOService(_client); - var guid= minIOService.Upload(formFile); - - return (IResult)Ok(guid.Result); + var guid = await minIOService.Upload(formFile); + + return Ok(guid); } [HttpPost]