Chuyển lưu trữ dữ liệu sang data base
Some checks failed
Test / test (push) Has been cancelled

This commit is contained in:
2026-06-17 11:16:30 +07:00
parent 4054d81aaf
commit 098e1b2b69
45 changed files with 1971 additions and 1657 deletions

View File

@@ -11,6 +11,8 @@
namespace lm {
class Database;
struct AuthSession
{
std::string token;
@@ -24,7 +26,7 @@ struct AuthSession
class AuthService
{
public:
explicit AuthService(std::filesystem::path store_path);
explicit AuthService(Database& db);
httplib::Server::HandlerResponse preRoute(const httplib::Request& req, httplib::Response& res);
@@ -55,7 +57,7 @@ public:
void registerRoutes(httplib::Server& svr);
private:
std::filesystem::path store_path_;
Database& db_;
mutable std::mutex mu_;
nlohmann::json data_;
std::unordered_map<std::string, AuthSession> sessions_;