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
2cc79369
Commit
2cc79369
authored
Jan 29, 2021
by
yangjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update AuthenticationStatus
parent
5ba269dd
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
36 deletions
+37
-36
etc/udr
etc/udr
+0
-0
src/impl/AuthenticationStatusDocumentApiImpl.cpp
src/impl/AuthenticationStatusDocumentApiImpl.cpp
+17
-17
src/model/AuthEvent.cpp
src/model/AuthEvent.cpp
+7
-6
src/model/AuthEvent.h
src/model/AuthEvent.h
+13
-13
No files found.
etc/udr
deleted
100755 → 0
View file @
5ba269dd
File deleted
src/impl/AuthenticationStatusDocumentApiImpl.cpp
View file @
2cc79369
...
...
@@ -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
);
...
...
src/model/AuthEvent.cpp
View file @
2cc79369
...
...
@@ -23,6 +23,7 @@ AuthEvent::AuthEvent()
m_NfInstanceId
=
""
;
m_Success
=
false
;
m_TimeStamp
=
""
;
m_AuthType
=
""
;
m_ServingNetworkName
=
""
;
m_AuthRemovalInd
=
false
;
m_AuthRemovalIndIsSet
=
false
;
...
...
@@ -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
;
}
...
...
src/model/AuthEvent.h
View file @
2cc79369
...
...
@@ -60,8 +60,8 @@ public:
/// <summary>
///
/// </summary>
AuthType
getAuthType
()
const
;
void
setAuthType
(
AuthType
const
&
value
);
std
::
string
getAuthType
()
const
;
void
setAuthType
(
std
::
string
const
&
value
);
/// <summary>
///
/// </summary>
...
...
@@ -84,7 +84,7 @@ protected:
std
::
string
m_TimeStamp
;
AuthType
m_AuthType
;
std
::
string
m_AuthType
;
std
::
string
m_ServingNetworkName
;
...
...
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