Commit 93bf8e9f authored by Mosaical's avatar Mosaical

20200925

parent 2856dcf6
...@@ -100,10 +100,10 @@ void NFInstanceIDDocumentApi::register_nf_instance_handler(const Pistache::Rest: ...@@ -100,10 +100,10 @@ void NFInstanceIDDocumentApi::register_nf_instance_handler(const Pistache::Rest:
try { try {
nlohmann::json::parse(request.body()).get_to(nFProfile); nlohmann::json::parse(request.body()).get_to(nFProfile);
std::string str1 = request.body().c_str(); //// std::string str1 = request.body().c_str();
nlohmann::json j1; //// nlohmann::json j1;
j1 = nlohmann::json::parse(str1);//str1的内容给了j1 //// j1 = nlohmann::json::parse(str1);//str1的内容给了j1
from_json(j1,nFProfile); //// from_json(j1,nFProfile);
// nlohmann::json j; // nlohmann::json j;
// NFProfile *o = &nFProfile; // NFProfile *o = &nFProfile;
// j["nfType"] = o->getNfType(); // j["nfType"] = o->getNfType();
......
{
"nfInstanceId": "AMFInstance1",
"nfStatus": "REGISTERED",
"nfType": "AMF"
}
{
"nfInstanceId": "AMFInstanceID1",
"nfStatus": "REGISTERED",
"nfType": "AMF"
}
{
"nfInstanceId": "AMFInstanceID2",
"nfStatus": "REGISTERED",
"nfType": "AMF"
}
{
"nfInstanceId": "SMFInstanceId1",
"nfStatus": "REGISTERED",
"nfType": "SMF"
}
No preview for this file type
No preview for this file type
...@@ -74,10 +74,13 @@ void NFInstanceIDDocumentApiImpl::register_nf_instance(const std::string &nfInst ...@@ -74,10 +74,13 @@ void NFInstanceIDDocumentApiImpl::register_nf_instance(const std::string &nfInst
std::string nfType; std::string nfType;
j.at("nfType").get_to(nfType); j.at("nfType").get_to(nfType);
std::string path; std::string path;
std::string fullPath;
path = source + nfType; path = source + nfType;
fullPath = path + "/" + nfInstanceId;
cout << " path: " << path << endl; cout << " path: " << path << endl;
bool b; bool b;
b = Register.registerZK(value, path, zk); b = Register.registerZK("this_is_A_nfType", path, zk);
b = Register.registerZK(value, fullPath, zk);
response.send(Pistache::Http::Code::Ok, "Do some magic\n"); response.send(Pistache::Http::Code::Ok, "Do some magic\n");
} }
void NFInstanceIDDocumentApiImpl::update_nf_instance(const std::string &nfInstanceID, const std::vector<PatchItem> &patchItem, const Pistache::Optional<Pistache::Http::Header::Raw> &contentEncoding, const Pistache::Optional<Pistache::Http::Header::Raw> &acceptEncoding, Pistache::Http::ResponseWriter &response) { void NFInstanceIDDocumentApiImpl::update_nf_instance(const std::string &nfInstanceID, const std::vector<PatchItem> &patchItem, const Pistache::Optional<Pistache::Http::Header::Raw> &contentEncoding, const Pistache::Optional<Pistache::Http::Header::Raw> &acceptEncoding, Pistache::Http::ResponseWriter &response) {
......
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