@@ -33,6 +33,6 @@ std::string QueryCustomerByIdRequest::getId()const
|
||||
void QueryCustomerByIdRequest::setId(const std::string& id)
|
||||
{
|
||||
id_ = id;
|
||||
setParameter("Id", id);
|
||||
setCoreParameter("Id", id);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,10 +35,13 @@ QueryCustomerByIdResult::~QueryCustomerByIdResult()
|
||||
|
||||
void QueryCustomerByIdResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::CharReaderBuilder builder;
|
||||
Json::CharReader *reader = builder.newCharReader();
|
||||
Json::Value *val;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
JSONCPP_STRING *errs;
|
||||
reader->parse(payload.data(), payload.data() + payload.size(), val, errs);
|
||||
value = *val;
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Id"].isNull())
|
||||
@@ -62,6 +65,14 @@ void QueryCustomerByIdResult::parse(const std::string &payload)
|
||||
data_.customizeFields.cid = customizeFieldsNode["Cid"].asString();
|
||||
if(!customizeFieldsNode["AbcUrl"].isNull())
|
||||
data_.customizeFields.abcUrl = customizeFieldsNode["AbcUrl"].asString();
|
||||
if(!customizeFieldsNode["DistributionLevel"].isNull())
|
||||
data_.customizeFields.distributionLevel = customizeFieldsNode["DistributionLevel"].asString();
|
||||
if(!customizeFieldsNode["MainAccountUid"].isNull())
|
||||
data_.customizeFields.mainAccountUid = customizeFieldsNode["MainAccountUid"].asString();
|
||||
if(!customizeFieldsNode["AssociatePerson"].isNull())
|
||||
data_.customizeFields.associatePerson = customizeFieldsNode["AssociatePerson"].asString();
|
||||
if(!customizeFieldsNode["Tag"].isNull())
|
||||
data_.customizeFields.tag = customizeFieldsNode["Tag"].asString();
|
||||
auto allAssociatePersonList = customizeFieldsNode["AssociatePersonList"]["AssociatePersonList"];
|
||||
for (auto value : allAssociatePersonList)
|
||||
data_.customizeFields.associatePersonList.push_back(value.asString());
|
||||
|
||||
@@ -33,6 +33,6 @@ std::string QueryCustomerByPhoneRequest::getPhone()const
|
||||
void QueryCustomerByPhoneRequest::setPhone(const std::string& phone)
|
||||
{
|
||||
phone_ = phone;
|
||||
setParameter("Phone", phone);
|
||||
setCoreParameter("Phone", phone);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,10 +35,13 @@ QueryCustomerByPhoneResult::~QueryCustomerByPhoneResult()
|
||||
|
||||
void QueryCustomerByPhoneResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::CharReaderBuilder builder;
|
||||
Json::CharReader *reader = builder.newCharReader();
|
||||
Json::Value *val;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
JSONCPP_STRING *errs;
|
||||
reader->parse(payload.data(), payload.data() + payload.size(), val, errs);
|
||||
value = *val;
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allData = value["Data"]["DataItem"];
|
||||
for (auto value : allData)
|
||||
|
||||
Reference in New Issue
Block a user