1、实现目录读取功能

This commit is contained in:
asypost committed 2026-06-27 18:37:37 +08:00
1 parent 6e60886fd3
commit fe476dff69
11 files changed
+320 -116

No files matched your search

+16
View File
@@ -16,6 +16,7 @@
#include "account_info.hpp"
#include "auth_token.hpp"
#include "default_repo.hpp"
#include "dir_info.hpp"
#include "file_info.hpp"
#include "repo_entry.hpp"
#include "repo_info.hpp"
@@ -272,6 +273,21 @@ namespace seafile
return download_url;
}
}
tl::expected<DirInfo, SeafileException> dirDetail(const std::string& repo_id, const std::string& path,
const std::string& token, const TokenType token_type) const
{
const auto auth = makeAuthToken(token, token_type);
const auto url = cpr::Url{makeUrl(std::format("/api/v2.1/repos/{}/dir/detail/", repo_id))};
const auto response = cpr::Get(url, cpr::Header{
{"accept", "application/json"},
{"authorization", auth}
}, cpr::Parameters{
{"path", path}
});
return parseResponse<DirInfo>(response);
}
};
}