Преглед изворни кода

上传模型校验是不是zip包

dengsixing пре 3 година
родитељ
комит
80a0e729c2

+ 5 - 1
4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/SceneProServiceImpl.java

@@ -3410,7 +3410,11 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
     @Override
     public ResultData uploadObjAndImg(String sceneNum, MultipartFile file) throws Exception{
         if(StrUtil.isEmpty(sceneNum)){
-            throw new BusinessException(ErrorCode.FAILURE_CODE_3001);
+            throw new BusinessException(ServerCode.PARAM_REQUIRED, "num");
+        }
+
+        if(!file.getOriginalFilename().endsWith(".zip")){
+            throw new BusinessException(ErrorCode.FAILURE_CODE_7015);
         }
 
         ScenePro scenePro = this.findBySceneNum(sceneNum);