Commit 4dd1b11f by 水库浪子

图片上传到本地

1 parent 3a65bab0
...@@ -149,8 +149,12 @@ public class WeMaterialController extends BaseController { ...@@ -149,8 +149,12 @@ public class WeMaterialController extends BaseController {
@PostMapping("/uploadimg") @PostMapping("/uploadimg")
@ApiOperation("上传素材图片") @ApiOperation("上传素材图片")
public AjaxResult<WeMediaDto> uploadImg(MultipartFile file){ public AjaxResult<WeMediaDto> uploadImg(MultipartFile file){
WeMediaDto weMediaDto = materialService.uploadImg(file); WeMediaDto weMediaDto=new WeMediaDto();
weMediaDto.setFileName(file.getResource().getFilename()); // WeMediaDto weMediaDto = materialService.uploadImg(file);
// weMediaDto.setFileName(file.getResource().getFilename());
WeMaterialFileVO weMaterialFileVO = materialService.uploadWeMaterialFile(file, MediaType.IMAGE.getType());
weMediaDto.setFileName(weMaterialFileVO.getMaterialName());
weMediaDto.setUrl(weMaterialFileVO.getMaterialUrl());
return AjaxResult.success(weMediaDto); return AjaxResult.success(weMediaDto);
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!