IM/MS/works/service/UserService.h

39 lines
991 B
C++

//
// Created by dongl on 23-4-23.
//
#ifndef IM2_USERSERVICE_H
#define IM2_USERSERVICE_H
#include "proto/mp.body.pb.h"
#include "Service.h"
class UserService : public Service {
public:
// 登陆 按subtype 分类是帐号登陆还是手机登陆
mp::sri* login(mp::MP_SUB_TYPE subType, const std::string& account, const std::string& password);
public:
// 注册 邮箱注册
mp::sri* register_(mp::MP_SUB_TYPE subType, const std::string& email,
const std::string& password, const std::string& code, const std::optional<std::string>& session_code);
public:
// 注销 退出登陆
mp::sri* logout(const std::string& account, bool state);
private:
// 注册 基函数
bool register_(uint64_t account, const std::string &password);
// 以account登陆
void login_fun(const std::string& account, const std::string& password, const std::string& filed);
private:
UserDB userDb = UserDB();
};
#endif //IM2_USERSERVICE_H