| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | |
| | | @RestController |
| | | @Api(tags = "文件上传") |
| | | @RequestMapping("/file") |
| | |
| | | @ApiOperation(value = "删除图片") |
| | | @PostMapping("media/delete") |
| | | public CommonResult<Boolean> deleteImages(String fileUrl) { |
| | | boolean flag = ossService.deleteImages(fileUrl); |
| | | boolean flag = false; |
| | | try { |
| | | flag = ossService.deleteImages(fileUrl); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | if (flag) { |
| | | return CommonResult.success(true, "删除成功"); |
| | | } |