thêm phần paths
Some checks failed
Test / test (push) Has been cancelled

This commit is contained in:
2026-06-23 17:51:54 +07:00
parent 50a2587cef
commit 2ce8a23ce9
25 changed files with 1411 additions and 31 deletions

View File

@@ -0,0 +1,33 @@
#pragma once
#include <nlohmann/json.hpp>
#include <mutex>
#include <optional>
#include <string>
namespace lm {
class Database;
class PathStore
{
public:
explicit PathStore(Database& db);
nlohmann::json list(const std::string& site_id = "") const;
std::optional<nlohmann::json> find(const std::string& id) const;
std::optional<nlohmann::json> findBetween(const std::string& map_id,
const std::string& from_position_id,
const std::string& to_position_id) const;
std::optional<nlohmann::json> upsert(const nlohmann::json& payload, std::string& err);
bool remove(const std::string& id, std::string& err);
int removeForMap(const std::string& map_id);
int removeForPosition(const std::string& map_id, const std::string& position_id);
private:
Database& db_;
mutable std::mutex mu_;
};
} // namespace lm