| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.List; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/upload") |
| | | public R synchronization(SynchronousRequest request) { |
| | | public R synchronization(SynchronousRequest request) throws ParseException { |
| | | if (ObjectUtil.isNull(request.getFile())) { |
| | | return R.fail("上传文件不能为空"); |
| | | } |
| | |
| | | /** |
| | | * 删除同步 |
| | | * |
| | | * @param ossIds OSS对象ID串 |
| | | * @param ossId OSS对象ID串 |
| | | */ |
| | | @SaCheckPermission("system:oss:remove") |
| | | @Log(title = "OSS对象存储", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ossIds}") |
| | | public R<Void> remove(@NotEmpty(message = "主键不能为空") |
| | | @PathVariable String ossIds) throws Exception { |
| | | return ossService.deleteWithValidByIds(List.of(convert(ossIds)), true,"000000") ? R.ok() : R.fail("提取码错误!"); |
| | | @PostMapping(value = "/delete") |
| | | public R<Void> remove(String ossId) throws Exception { |
| | | ossId = "12312312"; |
| | | return ossService.deleteWithValidByIds(List.of(convert(ossId)), true,"000000") ? R.ok() : R.fail("提取码错误!"); |
| | | } |
| | | |
| | | public static Long[] convert(String input) { |