|
@@ -1,5 +1,8 @@
|
|
|
package com.fdkankan.contro.controller;
|
|
|
|
|
|
+import com.fdkankan.common.constant.ErrorCode;
|
|
|
+import com.fdkankan.common.constant.ServerCode;
|
|
|
+import com.fdkankan.common.exception.BusinessException;
|
|
|
import com.fdkankan.contro.common.Result;
|
|
|
import com.fdkankan.contro.service.ISceneFileBuildService;
|
|
|
import com.fdkankan.contro.vo.ResponseSceneFile;
|
|
@@ -72,12 +75,12 @@ public class SceneFileController{
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "upload", method = RequestMethod.POST)
|
|
|
- public Result uploadFile(String key, @RequestParam("file") MultipartFile file) throws Exception {
|
|
|
+ public ResultData uploadFile(String key, @RequestParam("file") MultipartFile file) throws Exception {
|
|
|
if(ObjectUtils.isEmpty(key) || ObjectUtils.isEmpty(file)){
|
|
|
log.error("参数有误!");
|
|
|
- return Result.failure("参数有误!");
|
|
|
+ throw new BusinessException(ErrorCode.PARAM_REQUIRED);
|
|
|
}
|
|
|
fYunFileService.uploadFile(file.getInputStream(),key.concat(File.separator).concat(file.getOriginalFilename()));
|
|
|
- return Result.success();
|
|
|
+ return ResultData.ok();
|
|
|
}
|
|
|
}
|