60 lines
1.3 KiB
C++
60 lines
1.3 KiB
C++
//
|
|
// Created by dongl on 23-4-21.
|
|
//
|
|
|
|
#ifndef IM2_BODY_H
|
|
#define IM2_BODY_H
|
|
|
|
#include "proto/mp.body.pb.h"
|
|
|
|
class Body {
|
|
public:
|
|
|
|
// account 可能是 账户 手机号 邮箱
|
|
Body(mp::MP_SUB_TYPE subType, const std::string& account, const std::string& password) {
|
|
body = new mp::body();
|
|
|
|
body->set_subcommand(subType);
|
|
body->set_account(account);
|
|
body->set_password(password);
|
|
}
|
|
|
|
Body(mp::MP_SUB_TYPE subType, const std::string& account, const std::string& password, const std::string& data) {
|
|
body = new mp::body();
|
|
|
|
body->set_subcommand(subType);
|
|
body->set_account(account);
|
|
body->set_password(password);
|
|
body->set_data(data);
|
|
}
|
|
|
|
Body(mp::MP_SUB_TYPE subType, const std::string& account) {
|
|
body = new mp::body();
|
|
|
|
body->set_subcommand(subType);
|
|
body->set_account(account);
|
|
}
|
|
|
|
Body(mp::MP_SUB_TYPE subType, uint64_t target, uint64_t source, const std::string& data) {
|
|
body = new mp::body();
|
|
|
|
body->set_target(target);
|
|
body->set_source(source);
|
|
body->set_data(data);
|
|
body->set_subcommand(subType);
|
|
}
|
|
|
|
Body() {
|
|
body = new mp::body();
|
|
}
|
|
|
|
virtual ~Body() {
|
|
|
|
}
|
|
|
|
protected:
|
|
mp::body* body;
|
|
};
|
|
|
|
#endif //IM2_BODY_H
|