You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1007 B
Java
35 lines
1007 B
Java
package com.supervision.minio.controller;
|
|
|
|
import com.supervision.common.domain.R;
|
|
import com.supervision.minio.service.MinioService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
import java.io.IOException;
|
|
|
|
@RestController
|
|
@RequestMapping("minio")
|
|
public class MinioController {
|
|
|
|
@Autowired
|
|
private MinioService minioService;
|
|
|
|
@PostMapping("/uploadFile")
|
|
public String uploadFile(@RequestPart("file") MultipartFile file) throws IOException {
|
|
return minioService.uploadFile(file);
|
|
}
|
|
|
|
@GetMapping("/downloadFile")
|
|
public void downloadFile(@RequestParam String fileId, HttpServletResponse response) {
|
|
minioService.downloadFile(fileId, response);
|
|
}
|
|
|
|
@PostMapping("/delFile")
|
|
public R<?> delFile(@RequestParam String fileId) {
|
|
return minioService.delFile(fileId);
|
|
}
|
|
|
|
}
|