-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAsyncUserInfoCallback.h
More file actions
79 lines (65 loc) · 2.08 KB
/
Copy pathAsyncUserInfoCallback.h
File metadata and controls
79 lines (65 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#ifndef _ASYNC_USER_INFO_CB_H_
#define _ASYNC_USER_INFO_CB_H_
#include "HallServant.h"
#include "Robot.h"
using namespace userinfo;
using namespace hall;
/**
* 操作类型
*/
enum eumActType
{
E_ACT_TYPE_OFFLINE = 1, //机器人下线
E_ACT_TYPE_MODIFY_COIN = 2, //修改机器人货币
};
/**
* 异步用户信息回调类
*/
class AsyncUserInfoCallback : public HallServantPrxCallback
{
public:
/**
*
*/
AsyncUserInfoCallback(const userinfo::GetUserBasicReq &req);
/**
*
*/
AsyncUserInfoCallback(const userinfo::GetUserAccountReq &req, const CBatchRobotDataPtr &ptr,
const CRobotPtr &robotPtr, eumActType actType);
/**
*
*/
AsyncUserInfoCallback(const userinfo::ModifyUserAccountReq &req, const CBatchRobotDataPtr &ptr,
const CRobotPtr &robotPtr, eumActType actType);
/**
*
*/
~AsyncUserInfoCallback();
public:
//获取用户个人信息
void callback_getUserBasic(tars::Int32 ret, const userinfo::GetUserBasicResp &resp);
void callback_getUserBasic_exception(tars::Int32 ret);
//获取用户账号财富信息
void callback_getUserAccount(tars::Int32 ret, const userinfo::GetUserAccountResp &resp);
void callback_getUserAccount_exception(tars::Int32 ret);
//修改用户账号财富信息
void callback_modifyUserAccount(tars::Int32 ret);
void callback_modifyUserAccount_exception(tars::Int32 ret);
public:
//随机取数
long int nnrand(long int max, long int min = 0)
{
srand(TNOWMS);
return min + rand() % (max - min + 1);
}
private:
GetUserBasicReq m_reqGUB; //用户基本信息
GetUserAccountReq m_reqGUA; //用户账户信息
ModifyUserAccountReq m_reqMUA; //变更用户账户
private:
CBatchRobotDataPtr robotDataPtr; //机器人数据
CRobotPtr m_robotPtr; //机器人对象
eumActType m_actType; //操作类型
};
#endif // _ASYNC_USER_INFO_CB_H_