|
|
|
|
@ -32,11 +32,11 @@ public class UploadController {
|
|
|
|
|
|
|
|
|
|
@Log(title = "OSS对象存储", businessType = BusinessType.INSERT)
|
|
|
|
|
@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
|
|
|
|
public R upload(@RequestPart("file") MultipartFile file, String pre) {
|
|
|
|
|
public R upload(@RequestPart("file") MultipartFile file, String pre,@RequestParam(defaultValue = "false") Boolean keepFilename) {
|
|
|
|
|
if (ObjectUtil.isNull(file)) {
|
|
|
|
|
throw new ServiceException("文件为空");
|
|
|
|
|
}
|
|
|
|
|
return R.map().put("ossId",0).put("url",fileService.setPrefix(pre).setKeepFilename().save(file));
|
|
|
|
|
return R.map().put("ossId",0).put("url",fileService.setPrefix(pre).setKeepFilename(keepFilename).save(file));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Log(title = "OSS对象存储", businessType = BusinessType.INSERT)
|
|
|
|
|
|