上传文件

This commit is contained in:
遥望-倪浩天 2024-10-14 17:03:23 +08:00
parent dcee2ec067
commit 8ea2ecb27d
1 changed files with 13 additions and 0 deletions

View File

@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
@ -74,4 +75,16 @@ public class FileController {
}
return bladeFile;
}
/**
* 删除 images 文件
* @param
* @return
*/
@PostMapping("/removeFileImages")
public R<Boolean> removeFile(@RequestParam String fileUrl){
String[] fileUrlArr= fileUrl.split("/");
minioTemplate.removeFile("images",fileUrlArr[3]+"/"+fileUrlArr[4]+"/"+fileUrlArr[5]);
return R.data(true);
}
}