-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProcessor.cpp
More file actions
132 lines (101 loc) · 3.31 KB
/
Copy pathProcessor.cpp
File metadata and controls
132 lines (101 loc) · 3.31 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#include "Processor.h"
#include "globe.h"
#include "LogComm.h"
#include "DataProxyProto.h"
#include "ServiceDefine.h"
#include "util/tc_hash_fun.h"
#include "uuid.h"
#include "OrderServer.h"
//
using namespace std;
using namespace dataproxy;
using namespace dbagent;
/**
*
*/
Processor::Processor()
{
}
/**
*
*/
Processor::~Processor()
{
}
//ORDER_IOS = 87, //tb_ios_order
//查询
int Processor::selectIOSOrder()
{
// int iRet = 0;
// dataproxy::TReadDataReq dataReq;
// dataReq.keyName = I2S(E_REDIS_TYPE_HASH) + ":" + I2S(USER_STATE_ONLINE) + ":" + L2S(uid);
// dataReq.operateType = E_REDIS_READ;
// dataReq.clusterInfo.busiType = E_PROPERTY;
// dataReq.clusterInfo.frageFactorType = E_FRAGE_FACTOR_USER_ID;
// dataReq.clusterInfo.frageFactor = uid;
// vector<TField> fields;
// TField tfield;
// tfield.colArithType = E_NONE;
// tfield.colName = "access";
// tfield.colType = STRING;
// fields.push_back(tfield);
// dataReq.fields = fields;
// TReadDataRsp dataRsp;
// iRet = g_app.getOuterFactoryPtr()->getDataProxyServantPrx()->read(dataReq, dataRsp);
// ROLLLOG_DEBUG << "online state, iRet: " << iRet << ", dataRsp: " << printTars(dataRsp) << endl;
// //请求异常或应答错误
// if(iRet != 0 || dataRsp.iResult != 0)
// {
// ROLLLOG_ERROR << "online state err, iRet: " << iRet << ", iResult: " << dataRsp.iResult << endl;
// return -1;
// }
// ///取access addr
// string addr;
// for(auto it = dataRsp.fields.begin(); it != dataRsp.fields.end(); ++it)
// {
// for(auto itaddr = it->begin(); itaddr != it->end(); ++itaddr)
// {
// if(itaddr->colName == "access")
// {
// addr = itaddr->colValue;
// break;
// }
// }
// }
// //返回数据
// onlineState.state = userstate::E_ONLINE_STATE_ONLINE;
// onlineState.accessAddr = addr;
return 0;
}
//增加
int Processor::UpdateIOSOrder()
{
// int iRet = 0;
// dataproxy::TWriteDataReq wdataReq;
// wdataReq.keyName = I2S(E_REDIS_TYPE_HASH) + ":" + I2S(USER_STATE_ONLINE) + ":" + L2S(uid);
// wdataReq.operateType = E_REDIS_WRITE;
// wdataReq.clusterInfo.busiType = E_PROPERTY;
// wdataReq.clusterInfo.frageFactorType = E_FRAGE_FACTOR_USER_ID;
// wdataReq.clusterInfo.frageFactor = uid;
// vector<TField> fields;
// TField tfield;
// tfield.colArithType = E_NONE;
// fields.clear();
// tfield.colName = "access";
// tfield.colType = STRING;
// tfield.colValue = accessAddr;
// fields.push_back(tfield);
// //
// wdataReq.fields = fields;
// //
// TWriteDataRsp wdataRsp;
// iRet = g_app.getOuterFactoryPtr()->getDataProxyServantPrx()->write(wdataReq, wdataRsp);
// ROLLLOG_DEBUG << "set user access addr data, iRet: " << iRet << ", wdataRsp: " << printTars(wdataRsp) << endl;
// //请求异常或应答错误
// if(iRet != 0 || wdataRsp.iResult != 0)
// {
// ROLLLOG_ERROR << "save user access addr data err, iRet: " << iRet << ", iResult: " << wdataRsp.iResult << endl;
// return -1;
// }
return 0;
}