forked from mtusi2026/mtusi2026lab3
22 lines
525 B
C++
22 lines
525 B
C++
#pragma once
|
|
|
|
#include "db.hpp"
|
|
#include "models.hpp"
|
|
|
|
#include <optional>
|
|
#include <string>
|
|
|
|
class UserRepo {
|
|
public:
|
|
explicit UserRepo(PgPool& pool) : pool_(pool) {}
|
|
|
|
std::optional<User> create(const std::string& username,
|
|
const std::string& display_name,
|
|
const std::string& password_hash);
|
|
|
|
std::optional<User> find_by_id(const std::string& id);
|
|
std::optional<User> find_by_username(const std::string& username);
|
|
|
|
private:
|
|
PgPool& pool_;
|
|
}; |