|
|
@@ -1,11 +1,17 @@
|
|
|
package com.fdkankan.contro.controller;
|
|
|
|
|
|
+import cn.hutool.http.HttpUtil;
|
|
|
import com.fdkankan.contro.annotation.SignVerification;
|
|
|
+import com.fdkankan.contro.common.Result;
|
|
|
import com.fdkankan.contro.entity.ScenePlus;
|
|
|
+import com.fdkankan.contro.httpclient.MyClient;
|
|
|
import com.fdkankan.contro.service.IInnerService;
|
|
|
import com.fdkankan.contro.service.IScenePlusService;
|
|
|
import com.fdkankan.contro.service.ILocalFdageLogService;
|
|
|
import com.fdkankan.contro.vo.LocalfdageLogParamVo;
|
|
|
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
+import com.fdkankan.model.constants.ConstantFilePath;
|
|
|
+import com.fdkankan.model.constants.UploadFilePath;
|
|
|
import com.fdkankan.web.response.ResultData;
|
|
|
import lombok.extern.log4j.Log4j2;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -14,9 +20,13 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import javax.validation.Valid;
|
|
|
|
|
|
/**
|
|
|
@@ -83,5 +93,32 @@ public class InnerController {
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
|
|
|
+ @Autowired
|
|
|
+ FYunFileServiceInterface fYunFileServiceInterface;
|
|
|
+ @Resource
|
|
|
+ private MyClient myClient;
|
|
|
+
|
|
|
+ @SignVerification
|
|
|
+ @PostMapping("copyBuildScene")
|
|
|
+ public ResultData copyBuildScene(@RequestBody List<String> sources) throws Exception {
|
|
|
+ Map<String, String> result = new HashMap<>();
|
|
|
+ Map<String, String> headerMap = new HashMap<>();
|
|
|
+ headerMap.put("X-UA", "123");
|
|
|
+ for (String source : sources) {
|
|
|
+ String srcSource = source.replace("oss://4dkankan/", "");
|
|
|
+ String targetSource = srcSource.replace("linyanru", "home");
|
|
|
+ fYunFileServiceInterface.copyFileInBucket(srcSource, targetSource);
|
|
|
+ String dataSource = targetSource.replace("home", "/mnt/data");
|
|
|
+ String url = "https://www.4dkankan.com/api/scene/file/copyDataAndBuild?sceneVer=V4&sourceBucket=4dkankan&dataSource=" + dataSource;
|
|
|
+ ResultData<Map<String, String>> resultData = myClient.get2(url, headerMap);
|
|
|
+ if(resultData.getCode() == 0){
|
|
|
+ result.put(source, resultData.getData().get("code"));
|
|
|
+ }else{
|
|
|
+ result.put(source, resultData.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return ResultData.ok(result);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|