Commit 2cc79369 authored by yangjian's avatar yangjian

update AuthenticationStatus

parent 5ba269dd
File deleted
......@@ -36,14 +36,14 @@ void AuthenticationStatusDocumentApiImpl::create_authentication_status(const std
if (mysql_real_query(mysql_WitcommUDRDB,select_AuthenticationStatus.c_str(), (unsigned long)select_AuthenticationStatus.size()))
{
Logger::udr_server().error("mysql_real_query failure!SQL(%s)",select_AuthenticationStatus);
Logger::udr_server().error("mysql_real_query failure!SQL(%s)",select_AuthenticationStatus.c_str());
return;
}
res = mysql_store_result(mysql_WitcommUDRDB);
if(res == NULL)
{
Logger::udr_server().error("mysql_store_result failure!SQL(%s)",select_AuthenticationStatus);
Logger::udr_server().error("mysql_store_result failure!SQL(%s)",select_AuthenticationStatus.c_str());
return;
}
if (mysql_num_rows(res))
......@@ -51,10 +51,11 @@ void AuthenticationStatusDocumentApiImpl::create_authentication_status(const std
query="update AuthenticationStatus set nfInstanceId='"+authEvent.getNfInstanceId()+"'"+ \
",success="+(authEvent.isSuccess()?"1":"0")+ \
",timeStamp='"+authEvent.getTimeStamp()+"'"+ \
",authType='"+authEvent.getAuthType()+"'"+ \
",servingNetworkName='"+authEvent.getServingNetworkName()+"'"+ \
(authEvent.authRemovalIndIsSet()?(authEvent.isAuthRemovalInd()?",authRemovalInd=1":",authRemovalInd=0"):"");
to_json(j,authEvent.getAuthType());
query += ",authType='"+j.dump()+"'";
// to_json(j,authEvent.getAuthType());
// query += ",authType='"+j.dump()+"'";
query += " where ueid='"+ueId+"'";
}
else
......@@ -63,24 +64,24 @@ void AuthenticationStatusDocumentApiImpl::create_authentication_status(const std
",nfInstanceId='"+authEvent.getNfInstanceId()+"'"+ \
",success="+(authEvent.isSuccess()?"1":"0")+ \
",timeStamp='"+authEvent.getTimeStamp()+"'"+ \
",authType='"+authEvent.getAuthType()+"'"+ \
",servingNetworkName='"+authEvent.getServingNetworkName()+"'"+ \
(authEvent.authRemovalIndIsSet()?(authEvent.isAuthRemovalInd()?",authRemovalInd=1":",authRemovalInd=0"):"");
to_json(j,authEvent.getAuthType());
query += ",authType='"+j.dump()+"'";
// to_json(j,authEvent.getAuthType());
// query += ",authType='"+j.dump()+"'";
}
mysql_free_result(res);
if (mysql_real_query(mysql_WitcommUDRDB,query.c_str(), (unsigned long)query.size()))
{
Logger::udr_server().error("mysql create failure!");
Logger::udr_server().error("mysql create failure!SQL(%s)",query.c_str());
return;
}
response.send(Pistache::Http::Code::No_Content, "");
to_json(j,authEvent);
std::string out = j.dump();
Logger::udr_server().debug("AuthenticationStatus PUT - json:\n\"%s\"",out);
Logger::udr_server().debug("AuthenticationStatus PUT - json:\n\"%s\"",j.dump().c_str());
}
......@@ -90,7 +91,7 @@ void AuthenticationStatusDocumentApiImpl::delete_authentication_status(const std
if (mysql_real_query(mysql_WitcommUDRDB,query.c_str(), (unsigned long)query.size()))
{
Logger::udr_server().error("mysql_real_query failure!SQL(%s)",query);
Logger::udr_server().error("mysql_real_query failure!SQL(%s)",query.c_str());
return;
}
......@@ -110,7 +111,7 @@ void AuthenticationStatusDocumentApiImpl::query_authentication_status(const std:
if (mysql_real_query(mysql_WitcommUDRDB,query.c_str(), (unsigned long)query.size()))
{
Logger::udr_server().error("mysql_real_query failure!");
Logger::udr_server().error("mysql_real_query failure!SQL(%s)",query.c_str());
return;
}
......@@ -143,9 +144,9 @@ void AuthenticationStatusDocumentApiImpl::query_authentication_status(const std:
}
else if(!strcmp("authType", field->name))
{
AuthType authtype;
nlohmann::json::parse(row[i]).get_to(authtype);
authenticationstatus.setAuthType(authtype);
// AuthType authtype;
// nlohmann::json::parse(row[i]).get_to(authtype);
authenticationstatus.setAuthType(row[i]);
}
else if(!strcmp("servingNetworkName", field->name))
{
......@@ -163,12 +164,11 @@ void AuthenticationStatusDocumentApiImpl::query_authentication_status(const std:
to_json(j,authenticationstatus);
response.send(Pistache::Http::Code::Ok, j.dump());
std::string out = j.dump();
Logger::udr_server().debug("AuthenticationStatus GET - json:\n\"%s\"",out.c_str());
Logger::udr_server().debug("AuthenticationStatus GET - json:\n\"%s\"",j.dump().c_str());
}
else
{
Logger::udr_server().error("AuthenticationStatus no data!");
Logger::udr_server().error("AuthenticationStatus no data!SQL(%s)",query.c_str());
}
mysql_free_result(res);
......
/**
* Nudr_DataRepository API OpenAPI file
* Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.1.2
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
......@@ -23,10 +23,11 @@ AuthEvent::AuthEvent()
m_NfInstanceId = "";
m_Success = false;
m_TimeStamp = "";
m_AuthType = "";
m_ServingNetworkName = "";
m_AuthRemovalInd = false;
m_AuthRemovalIndIsSet = false;
}
AuthEvent::~AuthEvent()
......@@ -61,7 +62,7 @@ void from_json(const nlohmann::json& j, AuthEvent& o)
{
j.at("authRemovalInd").get_to(o.m_AuthRemovalInd);
o.m_AuthRemovalIndIsSet = true;
}
}
}
std::string AuthEvent::getNfInstanceId() const
......@@ -88,11 +89,11 @@ void AuthEvent::setTimeStamp(std::string const& value)
{
m_TimeStamp = value;
}
AuthType AuthEvent::getAuthType() const
std::string AuthEvent::getAuthType() const
{
return m_AuthType;
}
void AuthEvent::setAuthType(AuthType const& value)
void AuthEvent::setAuthType(std::string const& value)
{
m_AuthType = value;
}
......
/**
* Nudr_DataRepository API OpenAPI file
* Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.1.2
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
......@@ -12,7 +12,7 @@
/*
* AuthEvent.h
*
*
*
*/
#ifndef AuthEvent_H_
......@@ -29,7 +29,7 @@ namespace server {
namespace model {
/// <summary>
///
///
/// </summary>
class AuthEvent
{
......@@ -43,32 +43,32 @@ public:
/// AuthEvent members
/// <summary>
///
///
/// </summary>
std::string getNfInstanceId() const;
void setNfInstanceId(std::string const& value);
/// <summary>
///
///
/// </summary>
bool isSuccess() const;
void setSuccess(bool const value);
/// <summary>
///
///
/// </summary>
std::string getTimeStamp() const;
void setTimeStamp(std::string const& value);
/// <summary>
///
///
/// </summary>
AuthType getAuthType() const;
void setAuthType(AuthType const& value);
std::string getAuthType() const;
void setAuthType(std::string const& value);
/// <summary>
///
///
/// </summary>
std::string getServingNetworkName() const;
void setServingNetworkName(std::string const& value);
/// <summary>
///
///
/// </summary>
bool isAuthRemovalInd() const;
void setAuthRemovalInd(bool const value);
......@@ -84,7 +84,7 @@ protected:
std::string m_TimeStamp;
AuthType m_AuthType;
std::string m_AuthType;
std::string m_ServingNetworkName;
......
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