| | |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.resource.endpoint; |
| | | package org.springblade.Autowired.endpoint; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | import org.springblade.core.tool.constant.RoleConstant; |
| | | import org.springblade.core.tool.utils.FileUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.resource.builder.oss.OssBuilder; |
| | | import org.springblade.resource.entity.Attach; |
| | | import org.springblade.resource.service.IAttachService; |
| | | import org.springblade.Autowired.builder.oss.OssBuilder; |
| | | import org.springblade.Autowired.entity.Attach; |
| | | import org.springblade.Autowired.service.IAttachService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/make-bucket") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R makeBucket(@RequestParam String bucketName) { |
| | | ossBuilder.template().makeBucket(bucketName); |
| | | return R.success("创建成功"); |
| | |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/remove-bucket") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R removeBucket(@RequestParam String bucketName) { |
| | | ossBuilder.template().removeBucket(bucketName); |
| | | return R.success("删除成功"); |
| | |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/remove-file") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R removeFile(@RequestParam String fileName) { |
| | | ossBuilder.template().removeFile(fileName); |
| | | return R.success("操作成功"); |
| | |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/remove-files") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R removeFiles(@RequestParam String fileNames) { |
| | | ossBuilder.template().removeFiles(Func.toStrList(fileNames)); |
| | | return R.success("操作成功"); |