1. fix
This commit is contained in:
2026-04-07 16:20:43 +08:00
parent 279e04f3e9
commit 85f669aa34

View File

@@ -32,6 +32,7 @@ import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.oss.model.BladeFile;
import org.springblade.core.oss.model.OssFile;
import org.springblade.core.secure.annotation.IsAdmin;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.FileUtil;
@@ -102,6 +103,7 @@ public class OssEndpoint {
* @return R
*/
@SneakyThrows
@IsAdmin
@PostMapping("/copy-file")
public R copyFile(@RequestParam String bucketName, @RequestParam String fileName, @RequestParam String destBucketName, String destFileName) {
ossBuilder.template().copyFile(bucketName, fileName, destBucketName, destFileName);
@@ -115,6 +117,7 @@ public class OssEndpoint {
* @return InputStream
*/
@SneakyThrows
@IsAdmin
@GetMapping("/stat-file")
public R<OssFile> statFile(@RequestParam String fileName) {
return R.data(ossBuilder.template().statFile(fileName));
@@ -127,6 +130,7 @@ public class OssEndpoint {
* @return String
*/
@SneakyThrows
@IsAdmin
@GetMapping("/file-path")
public R<String> filePath(@RequestParam String fileName) {
return R.data(ossBuilder.template().filePath(fileName));
@@ -140,6 +144,7 @@ public class OssEndpoint {
* @return String
*/
@SneakyThrows
@IsAdmin
@GetMapping("/file-link")
public R<String> fileLink(@RequestParam String fileName) {
return R.data(ossBuilder.template().fileLink(fileName));
@@ -151,6 +156,7 @@ public class OssEndpoint {
* @param file 文件
* @return ObjectStat
*/
@PreAuth("hasAnyRole('administrator', 'admin', 'operator', 'APP', 'Market')")
@SneakyThrows
@PostMapping("/put-file")
public R<BladeFile> putFile(@RequestParam MultipartFile file) {
@@ -166,6 +172,7 @@ public class OssEndpoint {
* @return ObjectStat
*/
@SneakyThrows
@IsAdmin
@PostMapping("/put-file-by-name")
public R<BladeFile> putFile(@RequestParam String fileName, @RequestParam MultipartFile file) {
BladeFile bladeFile = ossBuilder.template().putFile(fileName, file.getInputStream());
@@ -179,6 +186,7 @@ public class OssEndpoint {
* @return ObjectStat
*/
@SneakyThrows
@IsAdmin
@PostMapping("/put-file-attach")
public R<BladeFile> putFileAttach(@RequestParam MultipartFile file) {
String fileName = file.getOriginalFilename();
@@ -196,6 +204,7 @@ public class OssEndpoint {
* @return ObjectStat
*/
@SneakyThrows
@IsAdmin
@PostMapping("/put-file-attach-by-name")
public R<BladeFile> putFileAttach(@RequestParam String fileName, @RequestParam MultipartFile file) {
BladeFile bladeFile = ossBuilder.template().putFile(fileName, file.getInputStream());