From d1793df1eda463b10107d41785ad1d7f055ed476 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sat, 18 May 2024 14:48:12 +0500 Subject: upd: moved the bot part to a relative subfolder --- src/schemas/user.hpp | 73 ---------------------------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 src/schemas/user.hpp (limited to 'src/schemas/user.hpp') diff --git a/src/schemas/user.hpp b/src/schemas/user.hpp deleted file mode 100644 index 0bd1368..0000000 --- a/src/schemas/user.hpp +++ /dev/null @@ -1,73 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -#include "../utils/chrono.hpp" - -namespace bot::schemas { - class User { - public: - User(const pqxx::row &row) { - this->id = row[0].as(); - this->alias_id = row[1].as(); - this->alias_name = row[2].as(); - - this->joined_at = - utils::chrono::string_to_time_point(row[3].as()); - - if (!row[4].is_null()) { - this->opted_out_at = - utils::chrono::string_to_time_point(row[4].as()); - } - } - - ~User() = default; - - const int &get_id() const { return this->id; } - const int &get_alias_id() const { return this->alias_id; } - const std::string &get_alias_name() const { return this->alias_name; } - void set_alias_name(const std::string &alias_name) { - this->alias_name = alias_name; - } - const std::chrono::system_clock::time_point &get_joined_at() const { - return this->joined_at; - } - const std::optional & - get_opted_out_at() const { - return this->opted_out_at; - } - - private: - int id, alias_id; - std::string alias_name; - std::chrono::system_clock::time_point joined_at; - std::optional opted_out_at; - }; - - enum PermissionLevel { SUSPENDED, USER, VIP, MODERATOR, BROADCASTER }; - - class UserRights { - public: - UserRights(const pqxx::row &row) { - this->id = row[0].as(); - this->user_id = row[1].as(); - this->channel_id = row[2].as(); - this->level = static_cast(row[3].as()); - } - - ~UserRights() = default; - - const int &get_id() const { return this->id; } - const int &get_user_id() const { return this->user_id; } - const int &get_channel_id() const { return this->channel_id; } - const PermissionLevel &get_level() const { return this->level; } - void set_level(PermissionLevel level) { this->level = level; } - - private: - int id, user_id, channel_id; - PermissionLevel level; - }; -} -- cgit v1.2.3