Commit a1b1240a authored by yangjian's avatar yangjian

Update AuthenticationSubscription: add fields(authenticationMethod/sequenceNumber/n5gcAuthMethod)

parent 11d0ae93
......@@ -67,7 +67,6 @@ void AuthenticationSubscriptionDocumentApiImpl::read_authentication_subscription
std::cout << "mysql_real_query failure!" << std::endl;
return;
}
std::cout << "mysql_real_query successful!" << std::endl;
res = mysql_store_result(mysql_WitcommUDRDB);
if(res == NULL)
......@@ -84,37 +83,41 @@ void AuthenticationSubscriptionDocumentApiImpl::read_authentication_subscription
{
if(!strcmp("authenticationMethod", field->name))
{
//authenticationsubscription.setAuthenticationMethod((AuthMethod) row[i]);
AuthMethod authenticationmethod;
nlohmann::json::parse(row[i]).get_to(authenticationmethod);
authenticationsubscription.setAuthenticationMethod(authenticationmethod);
}
else if(!strcmp("encPermanentKey", field->name))
else if(!strcmp("encPermanentKey", field->name) && row[i] != NULL)
{
authenticationsubscription.setEncPermanentKey(row[i]);
}
else if(!strcmp("protectionParameterId", field->name))
else if(!strcmp("protectionParameterId", field->name) && row[i] != NULL)
{
authenticationsubscription.setProtectionParameterId(row[i]);
}
else if(!strcmp("sequenceNumber", field->name))
else if(!strcmp("sequenceNumber", field->name) && row[i] != NULL)
{
//authenticationsubscription.setSequenceNumber((SequenceNumber) row[i]);
SequenceNumber sequencenumber;
nlohmann::json::parse(row[i]).get_to(sequencenumber);
authenticationsubscription.setSequenceNumber(sequencenumber);
}
else if(!strcmp("authenticationManagementField", field->name))
else if(!strcmp("authenticationManagementField", field->name) && row[i] != NULL)
{
authenticationsubscription.setAuthenticationManagementField(row[i]);
}
else if(!strcmp("algorithmId", field->name))
else if(!strcmp("algorithmId", field->name) && row[i] != NULL)
{
authenticationsubscription.setAlgorithmId(row[i]);
}
else if(!strcmp("encOpcKey", field->name))
else if(!strcmp("encOpcKey", field->name) && row[i] != NULL)
{
authenticationsubscription.setEncOpcKey(row[i]);
}
else if(!strcmp("encTopcKey", field->name))
else if(!strcmp("encTopcKey", field->name) && row[i] != NULL)
{
authenticationsubscription.setEncTopcKey(row[i]);
}
else if(!strcmp("vectorGenerationInHss", field->name))
else if(!strcmp("vectorGenerationInHss", field->name) && row[i] != NULL)
{
std::cout<<row[i]<<std::endl;
if(strcmp(row[i], "0"))
......@@ -122,11 +125,13 @@ void AuthenticationSubscriptionDocumentApiImpl::read_authentication_subscription
else
authenticationsubscription.setVectorGenerationInHss(false);
}
else if(!strcmp("n5gcAuthMethod", field->name))
else if(!strcmp("n5gcAuthMethod", field->name) && row[i] != NULL)
{
//authenticationsubscription.setN5gcAuthMethod(AuthMethod const & value);
AuthMethod n5gcauthmethod;
nlohmann::json::parse(row[i]).get_to(n5gcauthmethod);
authenticationsubscription.setN5gcAuthMethod(n5gcauthmethod);
}
else if(!strcmp("rgAuthenticationInd", field->name))
else if(!strcmp("rgAuthenticationInd", field->name) && row[i] != NULL)
{
std::cout<<row[i]<<std::endl;
if(strcmp(row[i], "0"))
......@@ -134,7 +139,7 @@ void AuthenticationSubscriptionDocumentApiImpl::read_authentication_subscription
else
authenticationsubscription.setRgAuthenticationInd(false);
}
else if(!strcmp("supi", field->name))
else if(!strcmp("supi", field->name) && row[i] != NULL)
{
authenticationsubscription.setSupi(row[i]);
}
......
......@@ -51,7 +51,7 @@ void to_json(nlohmann::json& j, const PatchItem& o)
void from_json(const nlohmann::json& j, PatchItem& o)
{
cout<<"patchitem from_json "<<endl;
// cout<<"patchitem from_json "<<endl;
j.at("op").get_to(o.m_Op);
j.at("path").get_to(o.m_Path);
if(j.find("from") != j.end())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment