forked from mtusi2026/mtusi2026lab3
lab3
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#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_;
|
||||
};
|
||||
Reference in New Issue
Block a user