1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-15 22:59:43 +00:00

Add rpc get_group_shared_repo_by_path().

This commit is contained in:
cuihaikuo
2017-10-30 17:44:33 +08:00
parent fa1e439633
commit e195ab4178
10 changed files with 134 additions and 7 deletions

View File

@@ -357,13 +357,19 @@ seaf_repo_manager_get_virtual_repo_id (SeafRepoManager *mgr,
char *sql;
char *ret;
sql = "SELECT RepoOwner.repo_id FROM RepoOwner, VirtualRepo "
"WHERE owner_id=? AND origin_repo=? AND path=? "
"AND RepoOwner.repo_id = VirtualRepo.repo_id";
ret = seaf_db_statement_get_string (mgr->seaf->db, sql,
3, "string", owner, "string", origin_repo,
"string", path);
if (owner) {
sql = "SELECT RepoOwner.repo_id FROM RepoOwner, VirtualRepo "
"WHERE owner_id=? AND origin_repo=? AND path=? "
"AND RepoOwner.repo_id = VirtualRepo.repo_id";
ret = seaf_db_statement_get_string (mgr->seaf->db, sql,
3, "string", owner,
"string", origin_repo, "string", path);
} else {
sql = "SELECT repo_id FROM VirtualRepo "
"WHERE origin_repo=? AND path=? ";
ret = seaf_db_statement_get_string (mgr->seaf->db, sql,
2, "string", origin_repo, "string", path);
}
return ret;
}