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
...
@@ -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
()))
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
;
return
;
}
}
res
=
mysql_store_result
(
mysql_WitcommUDRDB
);
res
=
mysql_store_result
(
mysql_WitcommUDRDB
);
if
(
res
==
NULL
)
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
;
return
;
}
}
if
(
mysql_num_rows
(
res
))
if
(
mysql_num_rows
(
res
))
...
@@ -51,10 +51,11 @@ void AuthenticationStatusDocumentApiImpl::create_authentication_status(const std
...
@@ -51,10 +51,11 @@ void AuthenticationStatusDocumentApiImpl::create_authentication_status(const std
query
=
"update AuthenticationStatus set nfInstanceId='"
+
authEvent
.
getNfInstanceId
()
+
"'"
+
\
query
=
"update AuthenticationStatus set nfInstanceId='"
+
authEvent
.
getNfInstanceId
()
+
"'"
+
\
",success="
+
(
authEvent
.
isSuccess
()
?
"1"
:
"0"
)
+
\
",success="
+
(
authEvent
.
isSuccess
()
?
"1"
:
"0"
)
+
\
",timeStamp='"
+
authEvent
.
getTimeStamp
()
+
"'"
+
\
",timeStamp='"
+
authEvent
.
getTimeStamp
()
+
"'"
+
\
",authType='"
+
authEvent
.
getAuthType
()
+
"'"
+
\
",servingNetworkName='"
+
authEvent
.
getServingNetworkName
()
+
"'"
+
\
",servingNetworkName='"
+
authEvent
.
getServingNetworkName
()
+
"'"
+
\
(
authEvent
.
authRemovalIndIsSet
()
?
(
authEvent
.
isAuthRemovalInd
()
?
",authRemovalInd=1"
:
",authRemovalInd=0"
)
:
""
);
(
authEvent
.
authRemovalIndIsSet
()
?
(
authEvent
.
isAuthRemovalInd
()
?
",authRemovalInd=1"
:
",authRemovalInd=0"
)
:
""
);
to_json
(
j
,
authEvent
.
getAuthType
());
//
to_json(j,authEvent.getAuthType());
query
+=
",authType='"
+
j
.
dump
()
+
"'"
;
//
query += ",authType='"+j.dump()+"'";
query
+=
" where ueid='"
+
ueId
+
"'"
;
query
+=
" where ueid='"
+
ueId
+
"'"
;
}
}
else
else
...
@@ -63,24 +64,24 @@ void AuthenticationStatusDocumentApiImpl::create_authentication_status(const std
...
@@ -63,24 +64,24 @@ void AuthenticationStatusDocumentApiImpl::create_authentication_status(const std
",nfInstanceId='"
+
authEvent
.
getNfInstanceId
()
+
"'"
+
\
",nfInstanceId='"
+
authEvent
.
getNfInstanceId
()
+
"'"
+
\
",success="
+
(
authEvent
.
isSuccess
()
?
"1"
:
"0"
)
+
\
",success="
+
(
authEvent
.
isSuccess
()
?
"1"
:
"0"
)
+
\
",timeStamp='"
+
authEvent
.
getTimeStamp
()
+
"'"
+
\
",timeStamp='"
+
authEvent
.
getTimeStamp
()
+
"'"
+
\
",authType='"
+
authEvent
.
getAuthType
()
+
"'"
+
\
",servingNetworkName='"
+
authEvent
.
getServingNetworkName
()
+
"'"
+
\
",servingNetworkName='"
+
authEvent
.
getServingNetworkName
()
+
"'"
+
\
(
authEvent
.
authRemovalIndIsSet
()
?
(
authEvent
.
isAuthRemovalInd
()
?
",authRemovalInd=1"
:
",authRemovalInd=0"
)
:
""
);
(
authEvent
.
authRemovalIndIsSet
()
?
(
authEvent
.
isAuthRemovalInd
()
?
",authRemovalInd=1"
:
",authRemovalInd=0"
)
:
""
);
to_json
(
j
,
authEvent
.
getAuthType
());
//
to_json(j,authEvent.getAuthType());
query
+=
",authType='"
+
j
.
dump
()
+
"'"
;
//
query += ",authType='"+j.dump()+"'";
}
}
mysql_free_result
(
res
);
mysql_free_result
(
res
);
if
(
mysql_real_query
(
mysql_WitcommUDRDB
,
query
.
c_str
(),
(
unsigned
long
)
query
.
size
()))
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
;
return
;
}
}
response
.
send
(
Pistache
::
Http
::
Code
::
No_Content
,
""
);
response
.
send
(
Pistache
::
Http
::
Code
::
No_Content
,
""
);
to_json
(
j
,
authEvent
);
to_json
(
j
,
authEvent
);
std
::
string
out
=
j
.
dump
();
Logger
::
udr_server
().
debug
(
"AuthenticationStatus PUT - json:
\n\"
%s
\"
"
,
j
.
dump
().
c_str
());
Logger
::
udr_server
().
debug
(
"AuthenticationStatus PUT - json:
\n\"
%s
\"
"
,
out
);
}
}
...
@@ -90,7 +91,7 @@ void AuthenticationStatusDocumentApiImpl::delete_authentication_status(const std
...
@@ -90,7 +91,7 @@ void AuthenticationStatusDocumentApiImpl::delete_authentication_status(const std
if
(
mysql_real_query
(
mysql_WitcommUDRDB
,
query
.
c_str
(),
(
unsigned
long
)
query
.
size
()))
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
;
return
;
}
}
...
@@ -110,7 +111,7 @@ void AuthenticationStatusDocumentApiImpl::query_authentication_status(const std:
...
@@ -110,7 +111,7 @@ void AuthenticationStatusDocumentApiImpl::query_authentication_status(const std:
if
(
mysql_real_query
(
mysql_WitcommUDRDB
,
query
.
c_str
(),
(
unsigned
long
)
query
.
size
()))
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
;
return
;
}
}
...
@@ -143,9 +144,9 @@ void AuthenticationStatusDocumentApiImpl::query_authentication_status(const std:
...
@@ -143,9 +144,9 @@ void AuthenticationStatusDocumentApiImpl::query_authentication_status(const std:
}
}
else
if
(
!
strcmp
(
"authType"
,
field
->
name
))
else
if
(
!
strcmp
(
"authType"
,
field
->
name
))
{
{
AuthType
authtype
;
//
AuthType authtype;
nlohmann
::
json
::
parse
(
row
[
i
]).
get_to
(
authtype
);
//
nlohmann::json::parse(row[i]).get_to(authtype);
authenticationstatus
.
setAuthType
(
authtype
);
authenticationstatus
.
setAuthType
(
row
[
i
]
);
}
}
else
if
(
!
strcmp
(
"servingNetworkName"
,
field
->
name
))
else
if
(
!
strcmp
(
"servingNetworkName"
,
field
->
name
))
{
{
...
@@ -163,12 +164,11 @@ void AuthenticationStatusDocumentApiImpl::query_authentication_status(const std:
...
@@ -163,12 +164,11 @@ void AuthenticationStatusDocumentApiImpl::query_authentication_status(const std:
to_json
(
j
,
authenticationstatus
);
to_json
(
j
,
authenticationstatus
);
response
.
send
(
Pistache
::
Http
::
Code
::
Ok
,
j
.
dump
());
response
.
send
(
Pistache
::
Http
::
Code
::
Ok
,
j
.
dump
());
std
::
string
out
=
j
.
dump
();
Logger
::
udr_server
().
debug
(
"AuthenticationStatus GET - json:
\n\"
%s
\"
"
,
j
.
dump
().
c_str
());
Logger
::
udr_server
().
debug
(
"AuthenticationStatus GET - json:
\n\"
%s
\"
"
,
out
.
c_str
());
}
}
else
else
{
{
Logger
::
udr_server
().
error
(
"AuthenticationStatus no data!
"
);
Logger
::
udr_server
().
error
(
"AuthenticationStatus no data!
SQL(%s)"
,
query
.
c_str
()
);
}
}
mysql_free_result
(
res
);
mysql_free_result
(
res
);
...
...
src/model/AuthEvent.cpp
View file @
2cc79369
...
@@ -23,6 +23,7 @@ AuthEvent::AuthEvent()
...
@@ -23,6 +23,7 @@ AuthEvent::AuthEvent()
m_NfInstanceId
=
""
;
m_NfInstanceId
=
""
;
m_Success
=
false
;
m_Success
=
false
;
m_TimeStamp
=
""
;
m_TimeStamp
=
""
;
m_AuthType
=
""
;
m_ServingNetworkName
=
""
;
m_ServingNetworkName
=
""
;
m_AuthRemovalInd
=
false
;
m_AuthRemovalInd
=
false
;
m_AuthRemovalIndIsSet
=
false
;
m_AuthRemovalIndIsSet
=
false
;
...
@@ -88,11 +89,11 @@ void AuthEvent::setTimeStamp(std::string const& value)
...
@@ -88,11 +89,11 @@ void AuthEvent::setTimeStamp(std::string const& value)
{
{
m_TimeStamp
=
value
;
m_TimeStamp
=
value
;
}
}
AuthType
AuthEvent
::
getAuthType
()
const
std
::
string
AuthEvent
::
getAuthType
()
const
{
{
return
m_AuthType
;
return
m_AuthType
;
}
}
void
AuthEvent
::
setAuthType
(
AuthType
const
&
value
)
void
AuthEvent
::
setAuthType
(
std
::
string
const
&
value
)
{
{
m_AuthType
=
value
;
m_AuthType
=
value
;
}
}
...
...
src/model/AuthEvent.h
View file @
2cc79369
...
@@ -60,8 +60,8 @@ public:
...
@@ -60,8 +60,8 @@ public:
/// <summary>
/// <summary>
///
///
/// </summary>
/// </summary>
AuthType
getAuthType
()
const
;
std
::
string
getAuthType
()
const
;
void
setAuthType
(
AuthType
const
&
value
);
void
setAuthType
(
std
::
string
const
&
value
);
/// <summary>
/// <summary>
///
///
/// </summary>
/// </summary>
...
@@ -84,7 +84,7 @@ protected:
...
@@ -84,7 +84,7 @@ protected:
std
::
string
m_TimeStamp
;
std
::
string
m_TimeStamp
;
AuthType
m_AuthType
;
std
::
string
m_AuthType
;
std
::
string
m_ServingNetworkName
;
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