25 lines
564 B
C++
25 lines
564 B
C++
#pragma once
|
|
|
|
#include "db.hpp"
|
|
#include "models.hpp"
|
|
|
|
#include <optional>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
class MessageRepo {
|
|
public:
|
|
explicit MessageRepo(PgPool& pool) : pool_(pool) {}
|
|
|
|
std::optional<Message> create(const std::string& chat_id,
|
|
const std::string& sender_id,
|
|
const std::string& text);
|
|
|
|
std::optional<MessagePage> list_page(
|
|
const std::string& chat_id,
|
|
int limit,
|
|
const std::optional<std::string>& cursor);
|
|
|
|
private:
|
|
PgPool& pool_;
|
|
}; |