| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- #include "respgetusersso.h"
- #include <QScriptValue>
- #include <QScriptEngine>
- #include <QScriptValueIterator>
- RespGetUserSSO::RespGetUserSSO(QString json)
- {
- this->json = json;
- QScriptEngine engine;
- QScriptValue sv = engine.evaluate("value = " + this->json);
- QScriptValueIterator it(sv);
- if(json.isEmpty())
- {
- rtnCode = RTNCODE_NETWORK_NOTAVAILABLE;
- rtnMemo = RTNMEMO_NETWORK_NOTAVAILABLE;
- }
- else if(json=="ABORT")
- {
- rtnCode = RTNCODE_NETWORK_ABORT;
- rtnMemo = RTNMEMO_NETWORK_ABORT;
- }
- else
- {
- rtnCode = RTNCODE_INVALID_FORMAT;
- rtnMemo = RTNMEMO_INVALID_FORMAT;
- while (it.hasNext())
- {
- it.next();
- if(it.name()=="rtnCode")
- {
- this->rtnCode = it.value().toInt32();
- }
- else if(it.name()=="rtnMemo")
- {
- this->rtnMemo = it.value().toString();
- }
- else if(it.name()=="rsCount")
- {
- this->rsCount = it.value().toInt32();
- }
- else
- {
- QScriptValue sv1 = it.value();
- map.insert("serialnum",sv1.property("serialnum").toString());
- map.insert("userID",sv1.property("userID").toString());
- map.insert("sysCode",sv1.property("sysCode").toString());
- map.insert("userCode",sv1.property("userCode").toString());
- map.insert("userMoney",sv1.property("userMoney").toString());
- map.insert("userGiftMoney",sv1.property("userGiftMoney").toString());
- map.insert("status",sv1.property("status").toString());
- map.insert("starttime",sv1.property("starttime").toString());
- map.insert("endtime",sv1.property("endtime").toString());
- }
- }
- }
- }
- int RespGetUserSSO::getRtnCode()
- {
- return this->rtnCode;
- }
- QString RespGetUserSSO::getRtnMemo()
- {
- return this->rtnMemo;
- }
- int RespGetUserSSO::getRsCount()
- {
- return this->rsCount;
- }
- QMultiMap<QString, QString> RespGetUserSSO::getRs()
- {
- return this->map;
- }
|