kopia lustrzana https://gitlab.com/tomaszg/geostat
geofriends: add missing okapi bits
rodzic
b52f0f23e6
commit
32e1053c6b
|
@ -251,6 +251,14 @@ Caches Okapi::get_user_caches(const std::string& uuid, int count) const {
|
|||
return cc;
|
||||
}
|
||||
|
||||
int Okapi::get_user_caches_no(const std::string& uuid) const {
|
||||
std::string service = url + OKAPI_user;
|
||||
std::string query = "consumer_key=" + key + "&user_uuid=" + uuid + "&fields=caches_hidden";
|
||||
curl_post(service, query);
|
||||
json j = json::parse(curl_output);
|
||||
return j["caches_hidden"];
|
||||
}
|
||||
|
||||
void Okapi::update_caches(Caches& cc) const {
|
||||
std::set<std::string> codes;
|
||||
for (auto& i : cc)
|
||||
|
|
1
okapi.h
1
okapi.h
|
@ -35,6 +35,7 @@ public:
|
|||
// Cache get_cache(std::string code);
|
||||
Caches get_caches(const std::set<std::string>& codes) const;
|
||||
Caches get_user_caches(const std::string& uuid, int count = 0) const override;
|
||||
int get_user_caches_no(const std::string& uuid) const;
|
||||
std::string get_changelog_json(int revision) const;
|
||||
|
||||
void update_caches(Caches& cc) const;
|
||||
|
|
Ładowanie…
Reference in New Issue