mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-09-03 00:14:23 +00:00
Add rpc for getting trash repo owner
This commit is contained in:
@@ -5099,4 +5099,15 @@ seafile_get_file_count_info_by_path (const char *repo_id,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
seafile_get_trash_repo_owner (const char *repo_id, GError **error)
|
||||||
|
{
|
||||||
|
if (!repo_id) {
|
||||||
|
g_set_error (error, SEAFILE_DOMAIN, SEAF_ERR_BAD_ARGS, "Argument should not be null");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return seaf_get_trash_repo_owner (repo_id);
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* SEAFILE_SERVER */
|
#endif /* SEAFILE_SERVER */
|
||||||
|
@@ -1038,4 +1038,7 @@ GObject *
|
|||||||
seafile_get_file_count_info_by_path (const char *repo_id,
|
seafile_get_file_count_info_by_path (const char *repo_id,
|
||||||
const char *path,
|
const char *path,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
|
char *
|
||||||
|
seafile_get_trash_repo_owner (const char *repo_id, GError **error);
|
||||||
#endif
|
#endif
|
||||||
|
@@ -964,3 +964,7 @@ class SeafServerThreadedRpcClient(ccnet.RpcClientBase):
|
|||||||
@searpc_func("object", ["string", "string"])
|
@searpc_func("object", ["string", "string"])
|
||||||
def get_file_count_info_by_path(repo_id, path):
|
def get_file_count_info_by_path(repo_id, path):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@searpc_func("string", ["string"])
|
||||||
|
def get_trash_repo_owner(repo_id):
|
||||||
|
pass
|
||||||
|
@@ -675,6 +675,9 @@ class SeafileAPI(object):
|
|||||||
def get_file_count_info_by_path(self, repo_id, path):
|
def get_file_count_info_by_path(self, repo_id, path):
|
||||||
return seafserv_threaded_rpc.get_file_count_info_by_path(repo_id, path)
|
return seafserv_threaded_rpc.get_file_count_info_by_path(repo_id, path)
|
||||||
|
|
||||||
|
def get_trash_repo_owner (self, repo_id):
|
||||||
|
return seafserv_threaded_rpc.get_trash_repo_owner(repo_id)
|
||||||
|
|
||||||
seafile_api = SeafileAPI()
|
seafile_api = SeafileAPI()
|
||||||
|
|
||||||
class CcnetAPI(object):
|
class CcnetAPI(object):
|
||||||
|
@@ -3729,3 +3729,10 @@ seaf_get_total_storage (GError **error)
|
|||||||
|
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
seaf_get_trash_repo_owner (const char *repo_id)
|
||||||
|
{
|
||||||
|
char *sql = "SELECT owner_id from RepoTrash WHERE repo_id = ?";
|
||||||
|
return seaf_db_statement_get_string(seaf->db, sql, 1, "string", repo_id);
|
||||||
|
}
|
||||||
|
@@ -815,4 +815,7 @@ seaf_get_total_file_number (GError **error);
|
|||||||
|
|
||||||
gint64
|
gint64
|
||||||
seaf_get_total_storage (GError **error);
|
seaf_get_total_storage (GError **error);
|
||||||
|
|
||||||
|
char *
|
||||||
|
seaf_get_trash_repo_owner (const char *repo_id);
|
||||||
#endif
|
#endif
|
||||||
|
@@ -368,6 +368,11 @@ static void start_rpc_service (CcnetClient *client, int cloud_mode)
|
|||||||
"get_file_count_info_by_path",
|
"get_file_count_info_by_path",
|
||||||
searpc_signature_object__string_string());
|
searpc_signature_object__string_string());
|
||||||
|
|
||||||
|
searpc_server_register_function ("seafserv-threaded-rpcserver",
|
||||||
|
seafile_get_trash_repo_owner,
|
||||||
|
"get_trash_repo_owner",
|
||||||
|
searpc_signature_string__string());
|
||||||
|
|
||||||
/* share repo to user */
|
/* share repo to user */
|
||||||
searpc_server_register_function ("seafserv-threaded-rpcserver",
|
searpc_server_register_function ("seafserv-threaded-rpcserver",
|
||||||
seafile_add_share,
|
seafile_add_share,
|
||||||
|
Reference in New Issue
Block a user