Commit a750aa69 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Get API version for NsmfEventExposure

parent c77a9a40
...@@ -12,6 +12,9 @@ ...@@ -12,6 +12,9 @@
#include "IndividualSubscriptionDocumentApi.h" #include "IndividualSubscriptionDocumentApi.h"
#include "Helpers.h" #include "Helpers.h"
#include "smf_config.hpp"
extern smf::smf_config smf_cfg;
namespace oai { namespace oai {
namespace smf_server { namespace smf_server {
...@@ -31,9 +34,9 @@ void IndividualSubscriptionDocumentApi::init() { ...@@ -31,9 +34,9 @@ void IndividualSubscriptionDocumentApi::init() {
void IndividualSubscriptionDocumentApi::setupRoutes() { void IndividualSubscriptionDocumentApi::setupRoutes() {
using namespace Pistache::Rest; using namespace Pistache::Rest;
Routes::Delete(*router, base + "/subscriptions/:subId", Routes::bind(&IndividualSubscriptionDocumentApi::delete_individual_subcription_handler, this)); Routes::Delete(*router, base + smf_cfg.sbi_api_version + "/subscriptions/:subId", Routes::bind(&IndividualSubscriptionDocumentApi::delete_individual_subcription_handler, this));
Routes::Get(*router, base + "/subscriptions/:subId", Routes::bind(&IndividualSubscriptionDocumentApi::get_individual_subcription_handler, this)); Routes::Get(*router, base + smf_cfg.sbi_api_version + "/subscriptions/:subId", Routes::bind(&IndividualSubscriptionDocumentApi::get_individual_subcription_handler, this));
Routes::Put(*router, base + "/subscriptions/:subId", Routes::bind(&IndividualSubscriptionDocumentApi::replace_individual_subcription_handler, this)); Routes::Put(*router, base + smf_cfg.sbi_api_version + "/subscriptions/:subId", Routes::bind(&IndividualSubscriptionDocumentApi::replace_individual_subcription_handler, this));
// Default handler, called when a route is not found // Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&IndividualSubscriptionDocumentApi::individual_subscription_document_api_default_handler, this)); router->addCustomHandler(Routes::bind(&IndividualSubscriptionDocumentApi::individual_subscription_document_api_default_handler, this));
......
...@@ -41,7 +41,7 @@ public: ...@@ -41,7 +41,7 @@ public:
virtual ~IndividualSubscriptionDocumentApi() {} virtual ~IndividualSubscriptionDocumentApi() {}
void init(); void init();
const std::string base = "/nsmf_event-exposure/v1"; const std::string base = "/nsmf_event-exposure/";
private: private:
void setupRoutes(); void setupRoutes();
......
...@@ -12,6 +12,9 @@ ...@@ -12,6 +12,9 @@
#include "SubscriptionsCollectionApi.h" #include "SubscriptionsCollectionApi.h"
#include "Helpers.h" #include "Helpers.h"
#include "smf_config.hpp"
extern smf::smf_config smf_cfg;
namespace oai { namespace oai {
namespace smf_server { namespace smf_server {
...@@ -31,7 +34,7 @@ void SubscriptionsCollectionApi::init() { ...@@ -31,7 +34,7 @@ void SubscriptionsCollectionApi::init() {
void SubscriptionsCollectionApi::setupRoutes() { void SubscriptionsCollectionApi::setupRoutes() {
using namespace Pistache::Rest; using namespace Pistache::Rest;
Routes::Post(*router, base + "/subscriptions", Routes::bind(&SubscriptionsCollectionApi::create_individual_subcription_handler, this)); Routes::Post(*router, base + smf_cfg.sbi_api_version + "/subscriptions", Routes::bind(&SubscriptionsCollectionApi::create_individual_subcription_handler, this));
// Default handler, called when a route is not found // Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&SubscriptionsCollectionApi::subscriptions_collection_api_default_handler, this)); router->addCustomHandler(Routes::bind(&SubscriptionsCollectionApi::subscriptions_collection_api_default_handler, this));
......
...@@ -40,7 +40,7 @@ public: ...@@ -40,7 +40,7 @@ public:
virtual ~SubscriptionsCollectionApi() {} virtual ~SubscriptionsCollectionApi() {}
void init(); void init();
const std::string base = "/nsmf_event-exposure/v1"; const std::string base = "/nsmf_event-exposure/";
private: private:
void setupRoutes(); void setupRoutes();
......
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