Commit 11d0ae93 authored by yangjian's avatar yangjian

Update SdmSubscriptions: add IndividualSdmSubscription and database

parent 85d44561
/**
* 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 @@
/*
* SDMSubscriptionDocumentApi.h
*
*
*
*/
#ifndef SDMSubscriptionDocumentApi_H_
......@@ -63,7 +63,7 @@ private:
/// Modify an individual sdm subscription
/// </summary>
/// <remarks>
///
///
/// </remarks>
/// <param name="ueId">UE id</param>
/// <param name="subsId"></param>
......@@ -75,7 +75,7 @@ private:
/// Retrieves a individual sdmSubscription identified by subsId
/// </summary>
/// <remarks>
///
///
/// </remarks>
/// <param name="ueId"></param>
/// <param name="subsId">Unique ID of the subscription to retrieve</param>
......@@ -85,7 +85,7 @@ private:
/// Deletes a sdmsubscriptions
/// </summary>
/// <remarks>
///
///
/// </remarks>
/// <param name="ueId"></param>
/// <param name="subsId">Unique ID of the subscription to remove</param>
......@@ -95,12 +95,12 @@ private:
/// Update an individual sdm subscriptions of a UE
/// </summary>
/// <remarks>
///
///
/// </remarks>
/// <param name="ueId"></param>
/// <param name="subsId"></param>
/// <param name="sdmSubscription"> (optional)</param>
virtual void updatesdmsubscriptions(const std::string &ueId, const std::string &subsId, const SdmSubscription &sdmSubscription, Pistache::Http::ResponseWriter &response) = 0;
virtual void updatesdmsubscriptions(const std::string &ueId, const std::string &subsId, SdmSubscription &sdmSubscription, Pistache::Http::ResponseWriter &response) = 0;
};
......
This diff is collapsed.
/**
* 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
......@@ -13,7 +13,7 @@
/*
* SDMSubscriptionDocumentApiImpl.h
*
*
*
*/
#ifndef SDM_SUBSCRIPTION_DOCUMENT_API_IMPL_H_
......@@ -37,6 +37,8 @@
#include <string>
#include <vector>
#include <mysql/mysql.h>
namespace org {
namespace openapitools {
namespace server {
......@@ -46,14 +48,15 @@ using namespace org::openapitools::server::model;
class SDMSubscriptionDocumentApiImpl : public org::openapitools::server::api::SDMSubscriptionDocumentApi {
public:
SDMSubscriptionDocumentApiImpl(std::shared_ptr<Pistache::Rest::Router>);
SDMSubscriptionDocumentApiImpl(std::shared_ptr<Pistache::Rest::Router>, MYSQL *mysql);
~SDMSubscriptionDocumentApiImpl() {}
void modifysdm_subscription(const std::string &ueId, const std::string &subsId, const std::vector<PatchItem> &patchItem, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response);
void querysdm_subscription(const std::string &ueId, const std::string &subsId, Pistache::Http::ResponseWriter &response);
void removesdm_subscriptions(const std::string &ueId, const std::string &subsId, Pistache::Http::ResponseWriter &response);
void updatesdmsubscriptions(const std::string &ueId, const std::string &subsId, const SdmSubscription &sdmSubscription, Pistache::Http::ResponseWriter &response);
void updatesdmsubscriptions(const std::string &ueId, const std::string &subsId, SdmSubscription &sdmSubscription, Pistache::Http::ResponseWriter &response);
private:
MYSQL *mysql_WitcommUDRDB;
};
}
......
......@@ -47,7 +47,7 @@ void SMFRegistrationDocumentApiImpl::create_smf_context_non3gpp(const std::strin
if (mysql_num_rows(res))
{
query="update SmfRegistrations set smfInstanceId='"+smfRegistration.getSmfInstanceId()+"',"+ \
(smfRegistration.smfSetIdIsSet()?"smfSetId='"+smfRegistration.getSupportedFeatures()+"',":"")+ \
(smfRegistration.smfSetIdIsSet()?"smfSetId='"+smfRegistration.getSmfSetId()+"',":"")+ \
(smfRegistration.supportedFeaturesIsSet()?"supportedFeatures='"+smfRegistration.getSupportedFeatures()+"',":"")+ \
(smfRegistration.dnnIsSet()?"dnn='"+smfRegistration.getDnn()+"',":"")+ \
(smfRegistration.emergencyServicesIsSet()?(smfRegistration.isEmergencyServices()?"emergencyServices=1,":"emergencyServices=0,"):"")+ \
......@@ -69,7 +69,7 @@ void SMFRegistrationDocumentApiImpl::create_smf_context_non3gpp(const std::strin
query="insert into SmfRegistrations set ueid="+ueId+","+ \
"pduSessionId="+std::to_string(pduSessionId)+","+ \
"smfInstanceId='"+smfRegistration.getSmfInstanceId()+"',"+ \
(smfRegistration.smfSetIdIsSet()?"smfSetId='"+smfRegistration.getSupportedFeatures()+"',":"")+ \
(smfRegistration.smfSetIdIsSet()?"smfSetId='"+smfRegistration.getSmfSetId()+"',":"")+ \
(smfRegistration.supportedFeaturesIsSet()?"supportedFeatures='"+smfRegistration.getSupportedFeatures()+"',":"")+ \
(smfRegistration.dnnIsSet()?"dnn='"+smfRegistration.getDnn()+"',":"")+ \
(smfRegistration.emergencyServicesIsSet()?(smfRegistration.isEmergencyServices()?"emergencyServices=1,":"emergencyServices=0,"):"")+ \
......
......@@ -303,7 +303,7 @@ int main() {
QueryODBDataBySUPIOrGPSIDocumentApiserver.init();
RetrievalOfSharedDataApiImpl RetrievalOfSharedDataApiserver(router);
RetrievalOfSharedDataApiserver.init();
SDMSubscriptionDocumentApiImpl SDMSubscriptionDocumentApiserver(router);
SDMSubscriptionDocumentApiImpl SDMSubscriptionDocumentApiserver(router, &mysql);
SDMSubscriptionDocumentApiserver.init();
SDMSubscriptionsCollectionApiImpl SDMSubscriptionsCollectionApiserver(router);
SDMSubscriptionsCollectionApiserver.init();
......
/**
* 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
......@@ -39,7 +39,7 @@ SdmSubscription::SdmSubscription()
m_SupportedFeatures = "";
m_SupportedFeaturesIsSet = false;
m_ContextInfoIsSet = false;
}
SdmSubscription::~SdmSubscription()
......@@ -88,59 +88,59 @@ void from_json(const nlohmann::json& j, SdmSubscription& o)
{
j.at("implicitUnsubscribe").get_to(o.m_ImplicitUnsubscribe);
o.m_ImplicitUnsubscribeIsSet = true;
}
}
if(j.find("expires") != j.end())
{
j.at("expires").get_to(o.m_Expires);
o.m_ExpiresIsSet = true;
}
}
j.at("callbackReference").get_to(o.m_CallbackReference);
if(j.find("amfServiceName") != j.end())
{
j.at("amfServiceName").get_to(o.m_AmfServiceName);
o.m_AmfServiceNameIsSet = true;
}
}
j.at("monitoredResourceUris").get_to(o.m_MonitoredResourceUris);
if(j.find("singleNssai") != j.end())
{
j.at("singleNssai").get_to(o.m_SingleNssai);
o.m_SingleNssaiIsSet = true;
}
}
if(j.find("dnn") != j.end())
{
j.at("dnn").get_to(o.m_Dnn);
o.m_DnnIsSet = true;
}
}
if(j.find("subscriptionId") != j.end())
{
j.at("subscriptionId").get_to(o.m_SubscriptionId);
o.m_SubscriptionIdIsSet = true;
}
}
if(j.find("plmnId") != j.end())
{
j.at("plmnId").get_to(o.m_PlmnId);
o.m_PlmnIdIsSet = true;
}
}
if(j.find("immediateReport") != j.end())
{
j.at("immediateReport").get_to(o.m_ImmediateReport);
o.m_ImmediateReportIsSet = true;
}
}
if(j.find("report") != j.end())
{
j.at("report").get_to(o.m_Report);
o.m_ReportIsSet = true;
}
}
if(j.find("supportedFeatures") != j.end())
{
j.at("supportedFeatures").get_to(o.m_SupportedFeatures);
o.m_SupportedFeaturesIsSet = true;
}
}
if(j.find("contextInfo") != j.end())
{
j.at("contextInfo").get_to(o.m_ContextInfo);
o.m_ContextInfoIsSet = true;
}
}
}
std::string SdmSubscription::getNfInstanceId() const
......
/**
* 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 @@
/*
* SdmSubscription.h
*
*
*
*/
#ifndef SdmSubscription_H_
......@@ -34,7 +34,7 @@ namespace server {
namespace model {
/// <summary>
///
///
/// </summary>
class SdmSubscription
{
......@@ -48,92 +48,92 @@ public:
/// SdmSubscription members
/// <summary>
///
///
/// </summary>
std::string getNfInstanceId() const;
void setNfInstanceId(std::string const& value);
/// <summary>
///
///
/// </summary>
bool isImplicitUnsubscribe() const;
void setImplicitUnsubscribe(bool const value);
bool implicitUnsubscribeIsSet() const;
void unsetImplicitUnsubscribe();
/// <summary>
///
///
/// </summary>
std::string getExpires() const;
void setExpires(std::string const& value);
bool expiresIsSet() const;
void unsetExpires();
/// <summary>
///
///
/// </summary>
std::string getCallbackReference() const;
void setCallbackReference(std::string const& value);
/// <summary>
///
///
/// </summary>
ServiceName getAmfServiceName() const;
void setAmfServiceName(ServiceName const& value);
bool amfServiceNameIsSet() const;
void unsetAmfServiceName();
/// <summary>
///
///
/// </summary>
std::vector<std::string>& getMonitoredResourceUris();
void setMonitoredResourceUris(std::vector<std::string> const& value);
/// <summary>
///
///
/// </summary>
Snssai getSingleNssai() const;
void setSingleNssai(Snssai const& value);
bool singleNssaiIsSet() const;
void unsetSingleNssai();
/// <summary>
///
///
/// </summary>
std::string getDnn() const;
void setDnn(std::string const& value);
bool dnnIsSet() const;
void unsetDnn();
/// <summary>
///
///
/// </summary>
std::string getSubscriptionId() const;
void setSubscriptionId(std::string const& value);
bool subscriptionIdIsSet() const;
void unsetSubscriptionId();
/// <summary>
///
///
/// </summary>
PlmnId getPlmnId() const;
void setPlmnId(PlmnId const& value);
bool plmnIdIsSet() const;
void unsetPlmnId();
/// <summary>
///
///
/// </summary>
bool isImmediateReport() const;
void setImmediateReport(bool const value);
bool immediateReportIsSet() const;
void unsetImmediateReport();
/// <summary>
///
///
/// </summary>
SubscriptionDataSets getReport() const;
void setReport(SubscriptionDataSets const& value);
bool reportIsSet() const;
void unsetReport();
/// <summary>
///
///
/// </summary>
std::string getSupportedFeatures() const;
void setSupportedFeatures(std::string const& value);
bool supportedFeaturesIsSet() const;
void unsetSupportedFeatures();
/// <summary>
///
///
/// </summary>
ContextInfo getContextInfo() const;
void setContextInfo(ContextInfo const& value);
......
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