|
@@ -10,6 +10,7 @@ import com.fdkankan.common.util.FileUtils;
|
|
import com.fdkankan.common.util.SnowflakeIdGenerator;
|
|
import com.fdkankan.common.util.SnowflakeIdGenerator;
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
import com.fdkankan.ucenter.common.constants.ResultCode;
|
|
import com.fdkankan.ucenter.common.constants.ResultCode;
|
|
|
|
+import com.fdkankan.ucenter.entity.SceneResource;
|
|
import com.fdkankan.ucenter.service.IScene3dNumService;
|
|
import com.fdkankan.ucenter.service.IScene3dNumService;
|
|
import com.fdkankan.ucenter.util.SceneResourcePath;
|
|
import com.fdkankan.ucenter.util.SceneResourcePath;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -20,6 +21,8 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.function.ObjDoubleConsumer;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
@Slf4j
|
|
@Slf4j
|
|
@@ -142,6 +145,18 @@ public class SceneCommonService {
|
|
if("v4".equals(sceneVersion)){
|
|
if("v4".equals(sceneVersion)){
|
|
String sceneJsonPath = String.format(SceneResourcePath.DATA_VIEW_PATH+"/scene.json", newNum);
|
|
String sceneJsonPath = String.format(SceneResourcePath.DATA_VIEW_PATH+"/scene.json", newNum);
|
|
fYunFileServiceInterface.uploadFile(localPath, sceneJsonPath);
|
|
fYunFileServiceInterface.uploadFile(localPath, sceneJsonPath);
|
|
|
|
+
|
|
|
|
+ //修改图片名称
|
|
|
|
+ String filePath = String.format(SceneResourcePath.USER_VIEW_PATH, newNum) ;
|
|
|
|
+ List<String> files = fYunFileServiceInterface.listRemoteFiles(filePath);
|
|
|
|
+ for (String fileName : files) {
|
|
|
|
+ if(fileName.contains(oldNum)){
|
|
|
|
+ String oldName = fileName;
|
|
|
|
+ fileName = fileName.replace(oldNum,newNum);
|
|
|
|
+ fYunFileServiceInterface.copyFileInBucket(oldName,fileName);
|
|
|
|
+ fYunFileServiceInterface.deleteFile(oldName);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
log.error("writeFile-error:{}",e);
|
|
log.error("writeFile-error:{}",e);
|