|
@@ -128,7 +128,7 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
|
|
throw new BusinessException(ResultCode.UPLOAD_FILE_CHINA_NAME);
|
|
throw new BusinessException(ResultCode.UPLOAD_FILE_CHINA_NAME);
|
|
}
|
|
}
|
|
redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"20");
|
|
redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"20");
|
|
- runThread(file1,objPath,model,newObjFile,objPathFile,this);
|
|
|
|
|
|
+ runThread(file1,model,newObjFile,objPathFile,this);
|
|
return model;
|
|
return model;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -138,7 +138,7 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
|
|
redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),status.toString());
|
|
redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),status.toString());
|
|
}
|
|
}
|
|
|
|
|
|
- private void runThread(File file1,String objPath,Model model,File newObjFile,File objPathFile,IModelService modelService){
|
|
|
|
|
|
+ private void runThread(File file1,Model model,File newObjFile,File objPathFile,IModelService modelService){
|
|
new Thread() {
|
|
new Thread() {
|
|
@Override
|
|
@Override
|
|
public void run() {
|
|
public void run() {
|
|
@@ -151,7 +151,7 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
|
|
glbOssPath = glbOssPath.replace("mesh.glb",file1.getName().replace(".obj",".glb"));
|
|
glbOssPath = glbOssPath.replace("mesh.glb",file1.getName().replace(".obj",".glb"));
|
|
model.setModelDateType("obj");
|
|
model.setModelDateType("obj");
|
|
model.setModelType("glb");
|
|
model.setModelType("glb");
|
|
- OBJToGLBUtil.objToGlb(objPath,name, file1.getPath().replace(".obj",".glb"));
|
|
|
|
|
|
+ OBJToGLBUtil.objToGlb2(file1.getPath(), file1.getPath().replace(".obj",".glb"));
|
|
redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"65");
|
|
redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"65");
|
|
uploadToOssUtil.uploadOss(file1.getPath().replace(".obj",".glb"),glbOssPath);
|
|
uploadToOssUtil.uploadOss(file1.getPath().replace(".obj",".glb"),glbOssPath);
|
|
}
|
|
}
|
|
@@ -170,7 +170,6 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
|
|
uploadToOssUtil.uploadFileOss(mntFile );
|
|
uploadToOssUtil.uploadFileOss(mntFile );
|
|
}
|
|
}
|
|
|
|
|
|
- model.setModelObjUrl(objPath);
|
|
|
|
model.setModelGlbUrl(queryPath + glbOssPath);
|
|
model.setModelGlbUrl(queryPath + glbOssPath);
|
|
model.setCreateStatus(1); //上传成功
|
|
model.setCreateStatus(1); //上传成功
|
|
modelService.saveOrUpdate(model);
|
|
modelService.saveOrUpdate(model);
|