Commit a537222f authored by liqin's avatar liqin 💬

bug fixed

parent 183e710d
...@@ -99,11 +99,11 @@ public class FileUploadController { ...@@ -99,11 +99,11 @@ public class FileUploadController {
// } // }
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "files", value = "资料", paramType = "form", dataType = "__file", collectionFormat = "array", allowMultiple = true) @ApiImplicitParam(name = "file", value = "资料", paramType = "form", dataType = "__file", collectionFormat = "array", allowMultiple = true)
}) })
@PostMapping(value = "/file/upload", headers = "content-type=multipart/form-data", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) @PostMapping(value = "/datum/upload", headers = "content-type=multipart/form-data", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@ApiOperation(value = "资料上传", notes = "资料上传") @ApiOperation(value = "资料上传", notes = "资料上传")
public ResponseEntity<BatchUploadResVO> uploadFile(@RequestPart(value = "files", required = false) MultipartFile[] files) throws IOException { public ResponseEntity<BatchUploadResVO> uploadFile(@RequestPart(value = "file", required = false) MultipartFile[] files) throws IOException {
if (files.length == 0) { if (files.length == 0) {
throw new InterfaceException(RESPONSE_CODE_ENUM.REQUEST_PARAMS_ERROR.getCode(), "没有文件可供上传"); throw new InterfaceException(RESPONSE_CODE_ENUM.REQUEST_PARAMS_ERROR.getCode(), "没有文件可供上传");
} }
...@@ -158,7 +158,7 @@ public class FileUploadController { ...@@ -158,7 +158,7 @@ public class FileUploadController {
@PostMapping(value = "/image/upload", headers = "content-type=multipart/form-data", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) @PostMapping(value = "/image/upload", headers = "content-type=multipart/form-data", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@RequiresPermissions("image:upload") @RequiresPermissions("image:upload")
@ApiOperation(value = "单图片上传", notes = "单图片上传") @ApiOperation(value = "单图片上传", notes = "单图片上传")
public ResponseEntity<ImageUploadResult> uploadImage(@RequestParam(value = "cover") MultipartFile uploadFile) throws Exception { public ResponseEntity<ImageUploadResult> uploadImage(@RequestParam(value = "file") MultipartFile uploadFile) throws Exception {
if (uploadFile == null || uploadFile.getSize() == 0) { if (uploadFile == null || uploadFile.getSize() == 0) {
throw new InterfaceException(RESPONSE_CODE_ENUM.REQUEST_PARAMS_ERROR.getCode(), "没有文件可供上传"); throw new InterfaceException(RESPONSE_CODE_ENUM.REQUEST_PARAMS_ERROR.getCode(), "没有文件可供上传");
} }
...@@ -182,12 +182,12 @@ public class FileUploadController { ...@@ -182,12 +182,12 @@ public class FileUploadController {
} }
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "files", value = "视频文件", paramType = "form", dataType = "__file", collectionFormat = "array", allowMultiple = true) @ApiImplicitParam(name = "file", value = "视频文件", paramType = "form", dataType = "__file", collectionFormat = "array", allowMultiple = true)
}) })
@PostMapping(value = "/video/upload", headers = "content-type=multipart/form-data", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) @PostMapping(value = "/video/upload", headers = "content-type=multipart/form-data", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@RequiresPermissions("video:upload") @RequiresPermissions("video:upload")
@ApiOperation(value = "多视频上传", notes = "多视频上传") @ApiOperation(value = "多视频上传", notes = "多视频上传")
public ResponseEntity<BatchUploadResVO> uploadVideo(@RequestPart(value = "files", required = false) MultipartFile[] files) throws IOException { public ResponseEntity<BatchUploadResVO> uploadVideo(@RequestPart(value = "file", required = false) MultipartFile[] files) throws IOException {
if (files.length == 0) { if (files.length == 0) {
throw new InterfaceException(RESPONSE_CODE_ENUM.REQUEST_PARAMS_ERROR.getCode(), "没有文件可供上传"); throw new InterfaceException(RESPONSE_CODE_ENUM.REQUEST_PARAMS_ERROR.getCode(), "没有文件可供上传");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment