43 lines
1.1 KiB
C++
43 lines
1.1 KiB
C++
//
|
|
// Created by dongl on 23-4-23.
|
|
//
|
|
|
|
#ifndef IM2_USERDB_H
|
|
#define IM2_USERDB_H
|
|
|
|
|
|
#include "linkDB.h"
|
|
#include "DB.h"
|
|
#include "po/po.h"
|
|
#include <optional>
|
|
|
|
class UserDB : public DB {
|
|
/// login ...
|
|
public:
|
|
// 查询用户
|
|
std::tuple<bool, PoUser> select_user(const std::string& account, const std::string& by_field);
|
|
// 查询用户是否存在
|
|
bool select_user_exist(uint64_t account);
|
|
// 添加用户
|
|
bool insert_user(uint64_t account, const std::string &password, const std::string &password_salt,
|
|
const std::string& client_info = "");
|
|
// 插入用户好友 初始好友 自己
|
|
bool insert_user_friends(uint64_t account, uint64_t friends = 0);
|
|
// 删除用户
|
|
bool remove_user(uint64_t account);
|
|
|
|
// 号池取号
|
|
std::optional<uint64_t> fetch_account();
|
|
// 号池内删除帐号
|
|
bool remove_pool_account(uint64_t account);
|
|
// 绑定邮箱
|
|
bool bind_email(uint64_t account, const std::string& email);
|
|
// 绑定手机
|
|
bool bind_phone(uint64_t account, const std::string& phone);
|
|
|
|
|
|
};
|
|
|
|
|
|
#endif //IM2_USERDB_H
|