pull/3/head
rekoe 2016-03-25 13:41:04 +08:00
parent b41bf9b25d
commit ace8f8ee1d
2 changed files with 20 additions and 1 deletions

View File

@ -1,8 +1,10 @@
package com.rekoe.service; package com.rekoe.service;
import org.apache.commons.lang3.StringUtils;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import com.rekoe.domain.Pj;
import com.rekoe.domain.ProjectConfig; import com.rekoe.domain.ProjectConfig;
/** /**
@ -34,4 +36,17 @@ public class ProjectConfigService extends BaseService<ProjectConfig> {
public void init() { public void init() {
get(); get();
} }
public String getRepoPath(String pj) {
ProjectConfig conf = get();
String path = conf.getRepositoryPath();
if (!StringUtils.endsWith(path, "/") || !StringUtils.endsWith(path, "\\")) {
path += "/";
}
return path + pj;
}
public String getRepoPath(Pj pj) {
return getRepoPath(pj.getPj());
}
} }

View File

@ -56,6 +56,9 @@ public class SvnService {
@Inject @Inject
private ProjectGroupUsrService projectGroupUsrService; private ProjectGroupUsrService projectGroupUsrService;
@Inject
private ProjectConfigService projectConfigService;
/** /**
* *
* *
@ -76,7 +79,8 @@ public class SvnService {
if (pj == null) { if (pj == null) {
return; return;
} }
File parent = new File(pj.getPath()); String path = projectConfigService.get().getRepositoryPath() + pj.getPj();
File parent = new File(path);
if (!parent.exists() || !parent.isDirectory()) { if (!parent.exists() || !parent.isDirectory()) {
throw new RuntimeException(String.format("找不到仓库 路径 %s", pj.getPath())); throw new RuntimeException(String.format("找不到仓库 路径 %s", pj.getPath()));
} }