66 lines
1.9 KiB
C++
Executable File
66 lines
1.9 KiB
C++
Executable File
/**
|
|
* NomNotification object
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Hanna E. Rathje, ESZS, 2025-06-23
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "dds_handler.h"
|
|
//#include "nom_db.h"
|
|
#include <DDS/Core/function_reply_object.h>
|
|
|
|
// Generated
|
|
#include <NotificationManagement/nom_db.h>
|
|
|
|
namespace NotificationManagement
|
|
{
|
|
|
|
class ObjectNotification final
|
|
{
|
|
public:
|
|
explicit ObjectNotification(const std::shared_ptr<DdsHandler> &ddsHandler,
|
|
const std::shared_ptr<DatabaseInterface> &db);
|
|
|
|
~ObjectNotification();
|
|
|
|
Core::FunctionReplyObject createObject(const NomNotification &data);
|
|
Core::FunctionReplyObject readReceipt(const ReadReceipt &data, int notificationId);
|
|
Core::FunctionReplyObject deleteMessage(const DeleteMessage &data, int notificationId);
|
|
Core::FunctionReplyObject deleteObject(const DeleteMessage &data, int notificationId);
|
|
Core::FunctionReplyObject removeObject();
|
|
|
|
Core::FunctionReplyObject setUsed(bool isUsed);
|
|
|
|
qint32 id() const { return m_dataNotificationObject.id(); }
|
|
NomNotification notification() const { return m_dataNotificationObject; }
|
|
QString title() const { return QString::fromStdString(m_dataNotificationObject.title()); }
|
|
|
|
bool isValid() const;
|
|
bool isUsed() const;
|
|
|
|
|
|
// convert methods
|
|
Database::NomNotification toDbData(const NomNotification &ddsData); // dds -> db
|
|
static NomNotification toDdsData(const Database::NomNotification &dbData); // db -> dds
|
|
|
|
static Database::NomAddress toDbData(const Address &ddsData); // dds -> db
|
|
static Address toDdsData(const Database::NomAddress &dbData); // db -> dds
|
|
|
|
private:
|
|
void onPublishData();
|
|
QString contentArgsToJson();
|
|
static std::vector<std::string> jsonToContentArgs(const QString &properties);
|
|
|
|
private:
|
|
std::shared_ptr<DdsHandler> m_ddsHandler;
|
|
std::shared_ptr<DatabaseInterface> m_db;
|
|
NomNotification m_dataNotificationObject;
|
|
|
|
NGL::INGLLogger &m_logger;
|
|
|
|
};
|
|
} // namespace NotificationManagement
|