| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- #include "respgetmfsysparam.h"
- #include <QScriptValue>
- #include <QScriptEngine>
- #include <QScriptValueIterator>
- RespGetMfSysParam::RespGetMfSysParam(QString json)
- {
- this->json = json;
- QScriptEngine engine;
- QScriptValue sv = engine.evaluate("value = " + this->json);
- QScriptValueIterator it(sv);
- this->rsCount = 0;
- 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()=="JSJCpnumMinSize")
- {
- this->map.insert("JSJCpnumMinSize",it.value().toString());
- }
- else if(it.name()=="JSJCpnumMaxSize")
- {
- this->map.insert("JSJCpnumMaxSize",it.value().toString());
- }
- else if(it.name()=="srvStatus")
- {
- this->map.insert("srvStatus",it.value().toString());
- }
- }
- }
- }
- int RespGetMfSysParam::getRtnCode()
- {
- return this->rtnCode;
- }
- QString RespGetMfSysParam::getRtnMemo()
- {
- return this->rtnMemo;
- }
- int RespGetMfSysParam::getRsCount()
- {
- return this->rsCount;
- }
- QMap<QString,QString> RespGetMfSysParam::getRs()
- {
- return this->map;
- }
|