Commit dc31daa8 authored by 赵啸非's avatar 赵啸非

添加产品资源枚举类

parent 6a961e79
......@@ -152,11 +152,8 @@ public class SetupProjectServiceImpl extends AbstractCRUDServiceImpl<SetupProjec
destDir.mkdirs();
ua.setDestDirectory(destDir);
ua.extract();
} else if (uiZipFile.exists()) {
ZipUtil.unzip(uiZipFile, destDir);
} else {
throw new AppException("请上传项目工程资源文件!");
}
......@@ -168,8 +165,8 @@ public class SetupProjectServiceImpl extends AbstractCRUDServiceImpl<SetupProjec
//TODO: 资源逻辑
} else if (ProjectTypeEnum.PHP后端.getValue() == setupProjectEntity.getProjectType()) {
//TODO: 解压php逻辑
String sourcePath = this.publishPath + "/temp/project/" + ProductDisEnum.getByValue(setupProjectEntity.getProjectCode()).getDesc() + "/" + ProductDisEnum.getByValue(setupProjectEntity.getProjectCode()).getValue() + ".zip";
String sourceDirPath = this.publishPath + "/temp/project/" + ProductDisEnum.getByValue(setupProjectEntity.getProjectCode()).getDesc() + "/";
String sourcePath = sourceDirPath+ ProductDisEnum.getByValue(setupProjectEntity.getProjectCode()).getValue() + ".zip";
File file = new File(sourcePath);
log.info("文件路径:{},存在:{}", sourcePath, file.exists());
......@@ -178,7 +175,6 @@ public class SetupProjectServiceImpl extends AbstractCRUDServiceImpl<SetupProjec
boolean mkdirs = destDir.mkdirs();
log.info("创建目录:{},{}", destDir.getPath(), mkdirs);
}
if (!file.exists()) {
throw new AppException("请上传项目工程文件!");
}
......@@ -223,12 +219,11 @@ public class SetupProjectServiceImpl extends AbstractCRUDServiceImpl<SetupProjec
} catch (IOException e) {
log.error(e.getMessage());
}
callScript("project_deploy.sh", "4", publicPath);
callScript("project_deploy.sh", "4", sourcePath);
} else if (SystemUtil.getOsInfo().isWindows()) {
//todo
}
}
return Rest.ok();
......
......@@ -76,7 +76,7 @@ public class SetupProjectController extends BaseCRUDJsonBodyMappingController<Se
@Override
protected void doListBefore(SetupProjectEntity query, Map<String, Object> model, Context context) throws AppException {
query.setSize(50);
query.setOrderColList(Arrays.asList(new OrderCol("orderNum")));
query.setOrderColList(Arrays.asList(new OrderCol("projectCode"),new OrderCol("orderNum")));
super.doListBefore(query, model, context);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment