@@ -0,0 +1,25 @@
|
||||
#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_;
|
||||
};
|
||||
Reference in New Issue
Block a user