|
@@ -89,7 +89,7 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
|
|
|
File newObjFile = null;
|
|
|
try {
|
|
|
String objPath = String.format(OBJ_PATH , "modelId_"+model.getModelId()) ;
|
|
|
- String glbPath = String.format(GLB_PATH , "modelId_"+model.getModelId());
|
|
|
+ StringBuilder glbPath = new StringBuilder(String.format(GLB_PATH, "modelId_" + model.getModelId()));
|
|
|
String glbOssPath = String.format(FilePath.GLB_OSS_PATH, model.getModelId());
|
|
|
|
|
|
newObjFile = new File(objPath +"/" + fileName);
|
|
@@ -112,27 +112,30 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
|
|
|
String name = file1.getName();
|
|
|
if(name.contains("obj") || name.contains("OBJ")){
|
|
|
String glbName = "";
|
|
|
- if(glbPath.contains(".obj")){
|
|
|
+ if(glbPath.toString().contains(".obj")){
|
|
|
glbName = name.replace(".obj",".glb");
|
|
|
}
|
|
|
- if(glbPath.contains(".OBJ")){
|
|
|
+ if(glbPath.toString().contains(".OBJ")){
|
|
|
glbName = name.replace(".OBJ",".glb");
|
|
|
}
|
|
|
OBJToGLBUtil.objToGlb(objPath,name, glbPath+"/"+glbName);
|
|
|
glbOssPath = glbOssPath.replace("mesh.glb",glbName);
|
|
|
+ glbPath.append("/").append(glbName);
|
|
|
}
|
|
|
if(name.contains(".ply")){
|
|
|
glbOssPath = glbOssPath.replace("mesh.glb",name);
|
|
|
+ glbPath.append("/").append(name);
|
|
|
model.setModelDateType("ply");
|
|
|
model.setModelType("ply");
|
|
|
}
|
|
|
if(name.contains(".las")){
|
|
|
glbOssPath = glbOssPath.replace("mesh.glb",name);
|
|
|
+ glbPath.append("/").append(name);
|
|
|
model.setModelDateType("las");
|
|
|
model.setModelType("las");
|
|
|
}
|
|
|
}
|
|
|
- uploadToOssUtil.upload(glbPath,glbOssPath);
|
|
|
+ uploadToOssUtil.upload(glbPath.toString(),glbOssPath);
|
|
|
model.setModelObjUrl(objPath);
|
|
|
model.setModelGlbUrl(queryPath + glbOssPath);
|
|
|
model.setCreateStatus(1); //上传成功
|