Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-UDR
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-UDR
Commits
a1b1240a
Commit
a1b1240a
authored
Jan 19, 2021
by
yangjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update AuthenticationSubscription: add fields(authenticationMethod/sequenceNumber/n5gcAuthMethod)
parent
11d0ae93
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
126 additions
and
121 deletions
+126
-121
impl/AuthenticationSubscriptionDocumentApiImpl.cpp
impl/AuthenticationSubscriptionDocumentApiImpl.cpp
+120
-115
model/PatchItem.cpp
model/PatchItem.cpp
+6
-6
No files found.
impl/AuthenticationSubscriptionDocumentApiImpl.cpp
View file @
a1b1240a
/**
* 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
...
...
@@ -27,128 +27,133 @@ using namespace org::openapitools::server::model;
AuthenticationSubscriptionDocumentApiImpl
::
AuthenticationSubscriptionDocumentApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
MYSQL
*
mysql
)
:
AuthenticationSubscriptionDocumentApi
(
rtr
)
{
mysql_WitcommUDRDB
=
mysql
;
mysql_WitcommUDRDB
=
mysql
;
}
void
AuthenticationSubscriptionDocumentApiImpl
::
modify_authentication_subscription
(
const
std
::
string
&
ueId
,
const
std
::
vector
<
PatchItem
>
&
patchItem
,
const
Pistache
::
Optional
<
std
::
string
>
&
supportedFeatures
,
Pistache
::
Http
::
ResponseWriter
&
response
)
{
/************************ test ************************/
nlohmann
::
json
j
,
j1
;
for
(
int
i
=
0
;
i
<
patchItem
.
size
();
i
++
)
{
to_json
(
j1
,
patchItem
[
i
]);
j
+=
j1
;
}
response
.
send
(
Pistache
::
Http
::
Code
::
Ok
,
j
.
dump
());
//response.send(Pistache::Http::Code::Ok, "Do some magic hello\n");
/******************************************************/
//1.modify handler
//2.modify success
//3.send PatchResult
//response.send(Pistache::Http::Code::Ok, j.dump());
nlohmann
::
json
j
,
j1
;
for
(
int
i
=
0
;
i
<
patchItem
.
size
();
i
++
)
{
to_json
(
j1
,
patchItem
[
i
]);
j
+=
j1
;
}
response
.
send
(
Pistache
::
Http
::
Code
::
Ok
,
j
.
dump
());
//response.send(Pistache::Http::Code::Ok, "Do some magic hello\n");
/******************************************************/
//1.modify handler
//2.modify success
//3.send PatchResult
//response.send(Pistache::Http::Code::Ok, j.dump());
}
void
AuthenticationSubscriptionDocumentApiImpl
::
read_authentication_subscription
(
const
std
::
string
&
ueId
,
const
Pistache
::
Optional
<
std
::
string
>
&
supportedFeatures
,
Pistache
::
Http
::
ResponseWriter
&
response
)
void
AuthenticationSubscriptionDocumentApiImpl
::
read_authentication_subscription
(
const
std
::
string
&
ueId
,
const
Pistache
::
Optional
<
std
::
string
>
&
supportedFeatures
,
Pistache
::
Http
::
ResponseWriter
&
response
)
{
MYSQL_RES
*
res
=
NULL
;
MYSQL_ROW
row
;
MYSQL_FIELD
*
field
=
nullptr
;
nlohmann
::
json
j
;
AuthenticationSubscription
authenticationsubscription
;
const
std
::
string
query
=
"select * from AuthenticationSubscription WHERE ueid="
+
ueId
;
if
(
mysql_real_query
(
mysql_WitcommUDRDB
,
query
.
c_str
(),
(
unsigned
long
)
query
.
size
()))
{
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
)
{
std
::
cout
<<
"mysql_store_result failure!"
<<
std
::
endl
;
return
;
}
row
=
mysql_fetch_row
(
res
);
if
(
row
!=
NULL
)
{
for
(
int
i
=
0
;
field
=
mysql_fetch_field
(
res
);
i
++
)
{
if
(
!
strcmp
(
"authenticationMethod"
,
field
->
name
))
{
//authenticationsubscription.setAuthenticationMethod((AuthMethod) row[i]);
}
else
if
(
!
strcmp
(
"encPermanentKey"
,
field
->
name
))
{
authenticationsubscription
.
setEncPermanentKey
(
row
[
i
]);
}
else
if
(
!
strcmp
(
"protectionParameterId"
,
field
->
name
))
{
authenticationsubscription
.
setProtectionParameterId
(
row
[
i
]);
}
else
if
(
!
strcmp
(
"sequenceNumber"
,
field
->
name
))
{
//authenticationsubscription.setSequenceNumber((SequenceNumber) row[i]);
}
else
if
(
!
strcmp
(
"authenticationManagementField"
,
field
->
name
))
{
authenticationsubscription
.
setAuthenticationManagementField
(
row
[
i
]);
}
else
if
(
!
strcmp
(
"algorithmId"
,
field
->
name
))
{
authenticationsubscription
.
setAlgorithmId
(
row
[
i
]);
}
else
if
(
!
strcmp
(
"encOpcKey"
,
field
->
name
))
{
authenticationsubscription
.
setEncOpcKey
(
row
[
i
]);
}
else
if
(
!
strcmp
(
"encTopcKey"
,
field
->
name
))
{
authenticationsubscription
.
setEncTopcKey
(
row
[
i
]);
}
else
if
(
!
strcmp
(
"vectorGenerationInHss"
,
field
->
name
))
{
std
::
cout
<<
row
[
i
]
<<
std
::
endl
;
if
(
strcmp
(
row
[
i
],
"0"
))
authenticationsubscription
.
setVectorGenerationInHss
(
true
);
else
authenticationsubscription
.
setVectorGenerationInHss
(
false
);
}
else
if
(
!
strcmp
(
"n5gcAuthMethod"
,
field
->
name
))
{
//authenticationsubscription.setN5gcAuthMethod(AuthMethod const & value);
}
else
if
(
!
strcmp
(
"rgAuthenticationInd"
,
field
->
name
))
{
std
::
cout
<<
row
[
i
]
<<
std
::
endl
;
if
(
strcmp
(
row
[
i
],
"0"
))
authenticationsubscription
.
setRgAuthenticationInd
(
true
);
else
authenticationsubscription
.
setRgAuthenticationInd
(
false
);
}
else
if
(
!
strcmp
(
"supi"
,
field
->
name
))
{
authenticationsubscription
.
setSupi
(
row
[
i
]);
}
}
to_json
(
j
,
authenticationsubscription
);
response
.
send
(
Pistache
::
Http
::
Code
::
Ok
,
j
.
dump
());
}
else
{
std
::
cout
<<
"AuthenticationSubscription no data!"
<<
std
::
endl
;
}
mysql_free_result
(
res
);
MYSQL_RES
*
res
=
NULL
;
MYSQL_ROW
row
;
MYSQL_FIELD
*
field
=
nullptr
;
nlohmann
::
json
j
;
AuthenticationSubscription
authenticationsubscription
;
const
std
::
string
query
=
"select * from AuthenticationSubscription WHERE ueid="
+
ueId
;
if
(
mysql_real_query
(
mysql_WitcommUDRDB
,
query
.
c_str
(),
(
unsigned
long
)
query
.
size
()))
{
std
::
cout
<<
"mysql_real_query failure!"
<<
std
::
endl
;
return
;
}
res
=
mysql_store_result
(
mysql_WitcommUDRDB
);
if
(
res
==
NULL
)
{
std
::
cout
<<
"mysql_store_result failure!"
<<
std
::
endl
;
return
;
}
row
=
mysql_fetch_row
(
res
);
if
(
row
!=
NULL
)
{
for
(
int
i
=
0
;
field
=
mysql_fetch_field
(
res
);
i
++
)
{
if
(
!
strcmp
(
"authenticationMethod"
,
field
->
name
))
{
AuthMethod
authenticationmethod
;
nlohmann
::
json
::
parse
(
row
[
i
]).
get_to
(
authenticationmethod
);
authenticationsubscription
.
setAuthenticationMethod
(
authenticationmethod
);
}
else
if
(
!
strcmp
(
"encPermanentKey"
,
field
->
name
)
&&
row
[
i
]
!=
NULL
)
{
authenticationsubscription
.
setEncPermanentKey
(
row
[
i
]);
}
else
if
(
!
strcmp
(
"protectionParameterId"
,
field
->
name
)
&&
row
[
i
]
!=
NULL
)
{
authenticationsubscription
.
setProtectionParameterId
(
row
[
i
]);
}
else
if
(
!
strcmp
(
"sequenceNumber"
,
field
->
name
)
&&
row
[
i
]
!=
NULL
)
{
SequenceNumber
sequencenumber
;
nlohmann
::
json
::
parse
(
row
[
i
]).
get_to
(
sequencenumber
);
authenticationsubscription
.
setSequenceNumber
(
sequencenumber
);
}
else
if
(
!
strcmp
(
"authenticationManagementField"
,
field
->
name
)
&&
row
[
i
]
!=
NULL
)
{
authenticationsubscription
.
setAuthenticationManagementField
(
row
[
i
]);
}
else
if
(
!
strcmp
(
"algorithmId"
,
field
->
name
)
&&
row
[
i
]
!=
NULL
)
{
authenticationsubscription
.
setAlgorithmId
(
row
[
i
]);
}
else
if
(
!
strcmp
(
"encOpcKey"
,
field
->
name
)
&&
row
[
i
]
!=
NULL
)
{
authenticationsubscription
.
setEncOpcKey
(
row
[
i
]);
}
else
if
(
!
strcmp
(
"encTopcKey"
,
field
->
name
)
&&
row
[
i
]
!=
NULL
)
{
authenticationsubscription
.
setEncTopcKey
(
row
[
i
]);
}
else
if
(
!
strcmp
(
"vectorGenerationInHss"
,
field
->
name
)
&&
row
[
i
]
!=
NULL
)
{
std
::
cout
<<
row
[
i
]
<<
std
::
endl
;
if
(
strcmp
(
row
[
i
],
"0"
))
authenticationsubscription
.
setVectorGenerationInHss
(
true
);
else
authenticationsubscription
.
setVectorGenerationInHss
(
false
);
}
else
if
(
!
strcmp
(
"n5gcAuthMethod"
,
field
->
name
)
&&
row
[
i
]
!=
NULL
)
{
AuthMethod
n5gcauthmethod
;
nlohmann
::
json
::
parse
(
row
[
i
]).
get_to
(
n5gcauthmethod
);
authenticationsubscription
.
setN5gcAuthMethod
(
n5gcauthmethod
);
}
else
if
(
!
strcmp
(
"rgAuthenticationInd"
,
field
->
name
)
&&
row
[
i
]
!=
NULL
)
{
std
::
cout
<<
row
[
i
]
<<
std
::
endl
;
if
(
strcmp
(
row
[
i
],
"0"
))
authenticationsubscription
.
setRgAuthenticationInd
(
true
);
else
authenticationsubscription
.
setRgAuthenticationInd
(
false
);
}
else
if
(
!
strcmp
(
"supi"
,
field
->
name
)
&&
row
[
i
]
!=
NULL
)
{
authenticationsubscription
.
setSupi
(
row
[
i
]);
}
}
to_json
(
j
,
authenticationsubscription
);
response
.
send
(
Pistache
::
Http
::
Code
::
Ok
,
j
.
dump
());
}
else
{
std
::
cout
<<
"AuthenticationSubscription no data!"
<<
std
::
endl
;
}
mysql_free_result
(
res
);
}
...
...
model/PatchItem.cpp
View file @
a1b1240a
/**
* 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
...
...
@@ -26,7 +26,7 @@ PatchItem::PatchItem()
m_From
=
""
;
m_FromIsSet
=
false
;
m_ValueIsSet
=
false
;
}
PatchItem
::~
PatchItem
()
...
...
@@ -51,19 +51,19 @@ 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
())
{
j
.
at
(
"from"
).
get_to
(
o
.
m_From
);
o
.
m_FromIsSet
=
true
;
}
}
if
(
j
.
find
(
"value"
)
!=
j
.
end
())
{
// j.at("value").get_to(o.m_Value);
// o.m_ValueIsSet = true;
}
}
}
PatchOperation
PatchItem
::
getOp
()
const
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment