forked from mtusi2026/mtusi2026lab4
23 lines
540 B
C++
23 lines
540 B
C++
#pragma once
|
|
|
|
#include "db.hpp"
|
|
#include "models.hpp"
|
|
|
|
#include <optional>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
class ChatRepo {
|
|
public:
|
|
explicit ChatRepo(PgPool& pool) : pool_(pool) {}
|
|
|
|
std::optional<Chat> create(const std::string& title,
|
|
const std::vector<std::string>& member_ids);
|
|
|
|
std::optional<Chat> find_by_id(const std::string& id);
|
|
|
|
std::optional<ChatPage> list_for_user(const std::string& user_id, int limit, const std::optional<std::string>& cursor);
|
|
|
|
private:
|
|
PgPool& pool_;
|
|
}; |