|
@@ -1,15 +1,15 @@
|
|
|
package com.fdkankan.contro.controller;
|
|
|
|
|
|
+import com.fdkankan.contro.common.Result;
|
|
|
import com.fdkankan.contro.service.ISceneFileBuildService;
|
|
|
import com.fdkankan.contro.vo.ResponseSceneFile;
|
|
|
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
import com.fdkankan.web.response.ResultData;
|
|
|
import lombok.extern.log4j.Log4j2;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.util.ObjectUtils;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
@@ -22,6 +22,9 @@ import java.io.IOException;
|
|
|
public class SceneFileController{
|
|
|
|
|
|
@Autowired
|
|
|
+ private FYunFileServiceInterface fYunFileService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private ISceneFileBuildService sceneFileBuildService;
|
|
|
|
|
|
/**
|
|
@@ -61,4 +64,19 @@ public class SceneFileController{
|
|
|
public ResultData rebuildScene(@RequestParam(value = "num") String num,@RequestParam(value = "force",defaultValue = "false") Boolean force ) throws IOException {
|
|
|
return sceneFileBuildService.rebuildScene(num,force);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 上传文件
|
|
|
+ * @param file
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "upload", method = RequestMethod.POST)
|
|
|
+ public Result uploadFile(String key, @RequestParam("file") MultipartFile file) throws Exception {
|
|
|
+ if(ObjectUtils.isEmpty(key) || ObjectUtils.isEmpty(file)){
|
|
|
+ log.error("参数有误!");
|
|
|
+ return Result.failure("参数有误!");
|
|
|
+ }
|
|
|
+ fYunFileService.uploadFile(file.getInputStream(),key);
|
|
|
+ return Result.success();
|
|
|
+ }
|
|
|
}
|