|
|
|
@ -4,7 +4,6 @@ import io.swagger.annotations.Api;
|
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.SneakyThrows; |
|
|
|
|
import org.springblade.core.minio.MinioTemplate; |
|
|
|
|
import org.springblade.core.qiniu.QiniuTemplate; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
@ -27,8 +26,6 @@ public class UploadController {
|
|
|
|
|
|
|
|
|
|
private MinioTemplate minioTemplate; |
|
|
|
|
|
|
|
|
|
private QiniuTemplate qiniuTemplate; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* minio上传demo |
|
|
|
|
* |
|
|
|
@ -43,19 +40,4 @@ public class UploadController {
|
|
|
|
|
return R.data(link); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* qiniu上传demo |
|
|
|
|
* |
|
|
|
|
* @param file 上传文件 |
|
|
|
|
* @param fileKey 上传文件key |
|
|
|
|
* @return String |
|
|
|
|
*/ |
|
|
|
|
@SneakyThrows |
|
|
|
|
@PostMapping("put-qiniu-object") |
|
|
|
|
public R<String> putQiniuObject(@RequestParam MultipartFile file, @RequestParam String fileKey) { |
|
|
|
|
qiniuTemplate.putFile(fileKey,file); |
|
|
|
|
String link = qiniuTemplate.fileLink(fileKey); |
|
|
|
|
return R.data(link); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|