mirror of
https://github.com/Telecominfraproject/wlan-cloud-analytics.git
synced 2026-01-27 02:22:21 +00:00
Signed-off-by: stephb9959 <stephane.bourque@gmail.com>
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include "Poco/Net/NetException.h"
|
||||
#include "Poco/Net/SSLException.h"
|
||||
#include "Poco/JSON/Template.h"
|
||||
#include "Poco/JSON/JSONException.h"
|
||||
#include "Poco/Thread.h"
|
||||
|
||||
namespace OpenWifi {
|
||||
|
||||
@@ -14,7 +14,6 @@ namespace OpenWifi {
|
||||
struct WebSocketNotification {
|
||||
inline static uint64_t xid = 1;
|
||||
uint64_t notification_id = ++xid;
|
||||
// std::string type;
|
||||
std::uint64_t type_id=0;
|
||||
ContentStruct content;
|
||||
|
||||
@@ -26,7 +25,6 @@ namespace OpenWifi {
|
||||
template<typename ContentStruct>
|
||||
void WebSocketNotification<ContentStruct>::to_json(Poco::JSON::Object &Obj) const {
|
||||
RESTAPI_utils::field_to_json(Obj, "notification_id", notification_id);
|
||||
// RESTAPI_utils::field_to_json(Obj, "type", type);
|
||||
RESTAPI_utils::field_to_json(Obj, "type_id", type_id);
|
||||
RESTAPI_utils::field_to_json(Obj, "content", content);
|
||||
}
|
||||
@@ -35,7 +33,6 @@ namespace OpenWifi {
|
||||
bool WebSocketNotification<ContentStruct>::from_json(const Poco::JSON::Object::Ptr &Obj) {
|
||||
try {
|
||||
RESTAPI_utils::field_from_json(Obj, "notification_id", notification_id);
|
||||
// RESTAPI_utils::field_from_json(Obj, "type", type);
|
||||
RESTAPI_utils::field_from_json(Obj, "type_id", type_id);
|
||||
RESTAPI_utils::field_from_json(Obj, "content", content);
|
||||
return true;
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace OpenWifi {
|
||||
struct NotificationLogMessage {
|
||||
std::string msg;
|
||||
std::string level;
|
||||
std::string timestamp;
|
||||
std::uint64_t timestamp;
|
||||
std::string source;
|
||||
std::string thread_name;
|
||||
std::uint64_t thread_id=0;
|
||||
@@ -85,7 +85,7 @@ namespace OpenWifi {
|
||||
WebSocketClientNotificationLogMessage_t Msg;
|
||||
Msg.content.msg = m.getText();
|
||||
Msg.content.level = WebSocketLogger::to_string(m.getPriority());
|
||||
Msg.content.timestamp = Poco::DateTimeFormatter::format(m.getTime(), Poco::DateTimeFormat::ISO8601_FORMAT);
|
||||
Msg.content.timestamp = m.getTime().epochTime();
|
||||
Msg.content.source = m.getSource();
|
||||
Msg.content.thread_name = m.getThread();
|
||||
Msg.content.thread_id = m.getTid();
|
||||
|
||||
Reference in New Issue
Block a user