Apply clang-format to Lts/Common and DTC/enum headers
- Formatted all CodeGen module files (9 files) - Formatted LtsAppDescriptor module files - Formatted LtsAppManager/AppChooser files - Applied clang-format to all DTC and enum headers across modules - Removed coordTransTests from CommonUnitTestsPlaceholder (moved to tests/) Cosmetic changes only, no functional modifications. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
848 files changed
+89305
-100020
No files matched your search
Executable → Regular
+24
-31
@@ -1,63 +1,56 @@
|
||||
|
||||
|
||||
|
||||
#include "client_message.h"
|
||||
|
||||
#include "json_keys.h"
|
||||
#include "message_handler.h"
|
||||
|
||||
namespace LtsProjectionWorkstation
|
||||
{
|
||||
|
||||
|
||||
|
||||
LtsWebSocket::AbstractClientMessage *ClientMessageFactory::createMessage(LtsWebSocket::ReplyHandler *client, const QString &message)
|
||||
LtsWebSocket::AbstractClientMessage* ClientMessageFactory::createMessage(LtsWebSocket::ReplyHandler* client,
|
||||
const QString& message)
|
||||
{
|
||||
LtsWebSocket::AbstractClientMessage *result = checkAttributes(client, message);
|
||||
LtsWebSocket::AbstractClientMessage* result = checkAttributes(client, message);
|
||||
|
||||
if (result)
|
||||
return result;
|
||||
if (result)
|
||||
return result;
|
||||
|
||||
if (m_type == JsonKeys::LOGIN_REQUEST())
|
||||
result = new LoginRequest(m_messageHandler, client, m_type, m_uuid, m_data);
|
||||
if (m_type == JsonKeys::LOGIN_REQUEST())
|
||||
result = new LoginRequest(m_messageHandler, client, m_type, m_uuid, m_data);
|
||||
|
||||
if (m_type == JsonKeys::LOGOUT_REQUEST())
|
||||
result = new LoginRequest(m_messageHandler, client, m_type, m_uuid, m_data);
|
||||
if (m_type == JsonKeys::LOGOUT_REQUEST())
|
||||
result = new LoginRequest(m_messageHandler, client, m_type, m_uuid, m_data);
|
||||
|
||||
return checkResult(client, message, result);
|
||||
return checkResult(client, message, result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void LoginRequest::process()
|
||||
{
|
||||
if (hasValidData())
|
||||
{
|
||||
int userId = m_data.toObject().value(JsonKeys::USER_ID()).toInt(-1),
|
||||
userPriority = m_data.toObject().value(JsonKeys::USER_PRIORITY()).toInt(-1),
|
||||
exerciseId = m_data.toObject().value(JsonKeys::EXERCISE_ID()).toInt(-1);
|
||||
m_client->addReply(m_messageHandler->handleLoginRequest(userId, userPriority, exerciseId));
|
||||
}
|
||||
if (hasValidData())
|
||||
{
|
||||
int userId = m_data.toObject().value(JsonKeys::USER_ID()).toInt(-1),
|
||||
userPriority = m_data.toObject().value(JsonKeys::USER_PRIORITY()).toInt(-1),
|
||||
exerciseId = m_data.toObject().value(JsonKeys::EXERCISE_ID()).toInt(-1);
|
||||
m_client->addReply(m_messageHandler->handleLoginRequest(userId, userPriority, exerciseId));
|
||||
}
|
||||
}
|
||||
|
||||
bool LoginRequest::hasValidData() const
|
||||
{
|
||||
return m_data.isObject()
|
||||
&& m_data.toObject().value(JsonKeys::USER_ID()).toInt(-1) > -1
|
||||
&& m_data.toObject().value(JsonKeys::USER_PRIORITY()).toInt(-1) > -1
|
||||
&& m_data.toObject().value(JsonKeys::EXERCISE_ID()).toInt(-1) > -1;
|
||||
return m_data.isObject() && m_data.toObject().value(JsonKeys::USER_ID()).toInt(-1) > -1 &&
|
||||
m_data.toObject().value(JsonKeys::USER_PRIORITY()).toInt(-1) > -1 &&
|
||||
m_data.toObject().value(JsonKeys::EXERCISE_ID()).toInt(-1) > -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void LogoutRequest::process()
|
||||
{
|
||||
m_client->addReply(m_messageHandler->handleLogoutRequest());
|
||||
m_client->addReply(m_messageHandler->handleLogoutRequest());
|
||||
}
|
||||
|
||||
bool LogoutRequest::hasValidData() const
|
||||
{
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} // namespace LtsProjectionWorkstation
|
||||
Executable → Regular
+40
-37
@@ -1,12 +1,10 @@
|
||||
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LtsWebSocket/client_message_factory.h>
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
#include <LtsWebSocket/client_message_factory.h>
|
||||
|
||||
namespace LtsProjectionWorkstation
|
||||
{
|
||||
@@ -14,52 +12,57 @@ class MessageHandler;
|
||||
|
||||
class ClientMessageFactory : public LtsWebSocket::AbstractClientMessageFactory
|
||||
{
|
||||
public:
|
||||
explicit ClientMessageFactory(MessageHandler *messageHandler)
|
||||
: LtsWebSocket::AbstractClientMessageFactory(getLogger("ClientMessageFactory"))
|
||||
, m_messageHandler(messageHandler)
|
||||
{}
|
||||
public:
|
||||
explicit ClientMessageFactory(MessageHandler* messageHandler)
|
||||
: LtsWebSocket::AbstractClientMessageFactory(getLogger("ClientMessageFactory")),
|
||||
m_messageHandler(messageHandler)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
LtsWebSocket::AbstractClientMessage *createMessage(LtsWebSocket::ReplyHandler *client, const QString &message) override final;
|
||||
LtsWebSocket::AbstractClientMessage* createMessage(LtsWebSocket::ReplyHandler* client,
|
||||
const QString& message) override final;
|
||||
|
||||
private:
|
||||
MessageHandler *m_messageHandler;
|
||||
};
|
||||
private:
|
||||
MessageHandler* m_messageHandler;
|
||||
};
|
||||
|
||||
class ClientMessage : public LtsWebSocket::AbstractClientMessage
|
||||
{
|
||||
public:
|
||||
explicit ClientMessage(MessageHandler *messageHandler, LtsWebSocket::ReplyHandler *client, const QString &type, const QString &uuid, const QJsonValue &data)
|
||||
: AbstractClientMessage(client, type, uuid, data)
|
||||
, m_messageHandler(messageHandler)
|
||||
{}
|
||||
public:
|
||||
explicit ClientMessage(MessageHandler* messageHandler, LtsWebSocket::ReplyHandler* client, const QString& type,
|
||||
const QString& uuid, const QJsonValue& data)
|
||||
: AbstractClientMessage(client, type, uuid, data), m_messageHandler(messageHandler)
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
MessageHandler *m_messageHandler;
|
||||
|
||||
};
|
||||
protected:
|
||||
MessageHandler* m_messageHandler;
|
||||
};
|
||||
|
||||
class LoginRequest : public ClientMessage
|
||||
{
|
||||
public:
|
||||
explicit LoginRequest(MessageHandler *messageHandler, LtsWebSocket::ReplyHandler *client, const QString &type, const QString &uuid, const QJsonValue &data)
|
||||
: ClientMessage(messageHandler, client, type, uuid, data)
|
||||
{}
|
||||
public:
|
||||
explicit LoginRequest(MessageHandler* messageHandler, LtsWebSocket::ReplyHandler* client, const QString& type,
|
||||
const QString& uuid, const QJsonValue& data)
|
||||
: ClientMessage(messageHandler, client, type, uuid, data)
|
||||
{
|
||||
}
|
||||
|
||||
void process();
|
||||
bool hasValidData() const;
|
||||
};
|
||||
void process();
|
||||
bool hasValidData() const;
|
||||
};
|
||||
|
||||
class LogoutRequest : public ClientMessage
|
||||
{
|
||||
public:
|
||||
explicit LogoutRequest(MessageHandler *messageHandler, LtsWebSocket::ReplyHandler *client, const QString &type, const QString &uuid, const QJsonValue &data)
|
||||
: ClientMessage(messageHandler, client, type, uuid, data)
|
||||
{}
|
||||
public:
|
||||
explicit LogoutRequest(MessageHandler* messageHandler, LtsWebSocket::ReplyHandler* client, const QString& type,
|
||||
const QString& uuid, const QJsonValue& data)
|
||||
: ClientMessage(messageHandler, client, type, uuid, data)
|
||||
{
|
||||
}
|
||||
|
||||
void process();
|
||||
bool hasValidData() const;
|
||||
};
|
||||
void process();
|
||||
bool hasValidData() const;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace LtsProjectionWorkstation
|
||||
+87
-22
@@ -4,32 +4,97 @@
|
||||
|
||||
#include <QString>
|
||||
|
||||
namespace LtsProjectionWorkstation::JsonKeys {
|
||||
namespace LtsProjectionWorkstation::JsonKeys
|
||||
{
|
||||
|
||||
inline QString ERROR_MESSAGE() { return QStringLiteral("errorMessage"); }
|
||||
|
||||
inline QString LOGIN_REQUEST() { return QStringLiteral("loginRequest"); }
|
||||
inline QString LOGOUT_REQUEST() { return QStringLiteral("logoutRequest"); }
|
||||
inline QString DISCONNECT_REQUEST() {
|
||||
return QStringLiteral("disconnectRequest");
|
||||
inline QString ERROR_MESSAGE()
|
||||
{
|
||||
return QStringLiteral("errorMessage");
|
||||
}
|
||||
|
||||
inline QString LOGIN_REPLY() { return QStringLiteral("loginReply"); }
|
||||
inline QString LOGOUT_REPLY() { return QStringLiteral("logoutReply"); }
|
||||
inline QString DEDICAED_DISCONNECT() {
|
||||
return QStringLiteral("dedicatedDisconnect");
|
||||
inline QString LOGIN_REQUEST()
|
||||
{
|
||||
return QStringLiteral("loginRequest");
|
||||
}
|
||||
|
||||
inline QString USER_ID() { return QStringLiteral("userId"); }
|
||||
inline QString USER_PRIORITY() { return QStringLiteral("userPriority"); }
|
||||
inline QString EXERCISE_ID() { return QStringLiteral("exerciseId"); }
|
||||
inline QString NAME() { return QStringLiteral("name"); }
|
||||
inline QString PORT() { return QStringLiteral("port"); }
|
||||
inline QString WIDTH() { return QStringLiteral("width"); }
|
||||
inline QString HEIGHT() { return QStringLiteral("height"); }
|
||||
inline QString REASON() { return QStringLiteral("reason"); }
|
||||
inline QString SUCCESS() { return QStringLiteral("success"); }
|
||||
inline QString SCREENS() { return QStringLiteral("screens"); }
|
||||
inline QString SETTINGS_DATA() { return QStringLiteral("settingsData"); }
|
||||
inline QString LOGOUT_REQUEST()
|
||||
{
|
||||
return QStringLiteral("logoutRequest");
|
||||
}
|
||||
|
||||
inline QString DISCONNECT_REQUEST()
|
||||
{
|
||||
return QStringLiteral("disconnectRequest");
|
||||
}
|
||||
|
||||
inline QString LOGIN_REPLY()
|
||||
{
|
||||
return QStringLiteral("loginReply");
|
||||
}
|
||||
|
||||
inline QString LOGOUT_REPLY()
|
||||
{
|
||||
return QStringLiteral("logoutReply");
|
||||
}
|
||||
|
||||
inline QString DEDICAED_DISCONNECT()
|
||||
{
|
||||
return QStringLiteral("dedicatedDisconnect");
|
||||
}
|
||||
|
||||
inline QString USER_ID()
|
||||
{
|
||||
return QStringLiteral("userId");
|
||||
}
|
||||
|
||||
inline QString USER_PRIORITY()
|
||||
{
|
||||
return QStringLiteral("userPriority");
|
||||
}
|
||||
|
||||
inline QString EXERCISE_ID()
|
||||
{
|
||||
return QStringLiteral("exerciseId");
|
||||
}
|
||||
|
||||
inline QString NAME()
|
||||
{
|
||||
return QStringLiteral("name");
|
||||
}
|
||||
|
||||
inline QString PORT()
|
||||
{
|
||||
return QStringLiteral("port");
|
||||
}
|
||||
|
||||
inline QString WIDTH()
|
||||
{
|
||||
return QStringLiteral("width");
|
||||
}
|
||||
|
||||
inline QString HEIGHT()
|
||||
{
|
||||
return QStringLiteral("height");
|
||||
}
|
||||
|
||||
inline QString REASON()
|
||||
{
|
||||
return QStringLiteral("reason");
|
||||
}
|
||||
|
||||
inline QString SUCCESS()
|
||||
{
|
||||
return QStringLiteral("success");
|
||||
}
|
||||
|
||||
inline QString SCREENS()
|
||||
{
|
||||
return QStringLiteral("screens");
|
||||
}
|
||||
|
||||
inline QString SETTINGS_DATA()
|
||||
{
|
||||
return QStringLiteral("settingsData");
|
||||
}
|
||||
|
||||
} // namespace LtsProjectionWorkstation::JsonKeys
|
||||
Executable → Regular
+30
-30
@@ -1,53 +1,53 @@
|
||||
#include "message_factory.h"
|
||||
#include "messages.h"
|
||||
|
||||
#include "json_keys.h"
|
||||
#include "messages.h"
|
||||
|
||||
#include <LtsWebSocket/client_message.h>
|
||||
#include <LtsWebSocket/json_keys.h>
|
||||
|
||||
#include <QUuid>
|
||||
|
||||
namespace LtsProjectionWorkstation
|
||||
{
|
||||
|
||||
LtsWebSocket::AbstractClientMessage *MessageFactory::createMessage(LtsWebSocket::ReplyHandler *client, const QString &message)
|
||||
LtsWebSocket::AbstractClientMessage* MessageFactory::createMessage(LtsWebSocket::ReplyHandler* client,
|
||||
const QString& message)
|
||||
{
|
||||
|
||||
|
||||
if (m_uuid.isEmpty())
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Got message without uuid: " << message << "'";
|
||||
WARNING_LOG(m_logger) << "Created UUID for error message!";
|
||||
return new ErrorMessage(QUuid::createUuid().toString(), QStringLiteral("Got message without uuid"));
|
||||
}
|
||||
|
||||
LtsWebSocket::AbstractClientMessage *result = checkAttributes(client, message);
|
||||
if (m_uuid.isEmpty())
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Got message without uuid: " << message << "'";
|
||||
WARNING_LOG(m_logger) << "Created UUID for error message!";
|
||||
return new ErrorMessage(QUuid::createUuid().toString(), QStringLiteral("Got message without uuid"));
|
||||
}
|
||||
|
||||
if (result)
|
||||
return result;
|
||||
LtsWebSocket::AbstractClientMessage* result = checkAttributes(client, message);
|
||||
|
||||
if (m_type == JsonKeys::DEDICAED_DISCONNECT())
|
||||
result = new STC::DedicatedDisconnect(m_handler, client, m_type, m_uuid, m_data);
|
||||
if (result)
|
||||
return result;
|
||||
|
||||
if (m_type == JsonKeys::LOGIN_REPLY())
|
||||
result = new STC::LoginRequestReply(m_handler, client, m_type, m_uuid, m_data);
|
||||
if (m_type == JsonKeys::DEDICAED_DISCONNECT())
|
||||
result = new STC::DedicatedDisconnect(m_handler, client, m_type, m_uuid, m_data);
|
||||
|
||||
if (m_type == JsonKeys::LOGOUT_REPLY())
|
||||
result = new STC::LoginRequestReply(m_handler, client, m_type, m_uuid, m_data);
|
||||
if (m_type == JsonKeys::LOGIN_REPLY())
|
||||
result = new STC::LoginRequestReply(m_handler, client, m_type, m_uuid, m_data);
|
||||
|
||||
if (m_type == JsonKeys::LOGIN_REQUEST())
|
||||
result = new CTS::LoginRequest(m_handler, client, m_type, m_uuid, m_data);
|
||||
if (m_type == JsonKeys::LOGOUT_REPLY())
|
||||
result = new STC::LoginRequestReply(m_handler, client, m_type, m_uuid, m_data);
|
||||
|
||||
if (m_type == JsonKeys::LOGOUT_REQUEST())
|
||||
result = new CTS::LogoutRequest(m_handler, client, m_type, m_uuid, m_data);
|
||||
if (m_type == JsonKeys::LOGIN_REQUEST())
|
||||
result = new CTS::LoginRequest(m_handler, client, m_type, m_uuid, m_data);
|
||||
|
||||
if (m_type == JsonKeys::DISCONNECT_REQUEST())
|
||||
result = new CTS::DisconnectRequest(m_handler, client, m_type, m_uuid, m_data);
|
||||
if (m_type == JsonKeys::LOGOUT_REQUEST())
|
||||
result = new CTS::LogoutRequest(m_handler, client, m_type, m_uuid, m_data);
|
||||
|
||||
if (m_type == LtsWebSocket::JsonKeys::ERROR_())
|
||||
return nullptr;
|
||||
if (m_type == JsonKeys::DISCONNECT_REQUEST())
|
||||
result = new CTS::DisconnectRequest(m_handler, client, m_type, m_uuid, m_data);
|
||||
|
||||
return checkResult(client, message, result);
|
||||
if (m_type == LtsWebSocket::JsonKeys::ERROR_())
|
||||
return nullptr;
|
||||
|
||||
return checkResult(client, message, result);
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace LtsProjectionWorkstation
|
||||
Executable → Regular
+14
-15
@@ -1,30 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include <LtsWebSocket/client_message_factory.h>
|
||||
#include <LtsProjectionWorkstation/logger.h>
|
||||
|
||||
#include "ltsprojectionworkstation_export.h"
|
||||
|
||||
#include <LtsProjectionWorkstation/logger.h>
|
||||
#include <LtsWebSocket/client_message_factory.h>
|
||||
|
||||
namespace LtsProjectionWorkstation
|
||||
{
|
||||
|
||||
class AbstractMessageHandler;
|
||||
|
||||
class LTSPROJECTIONWORKSTATION_EXPORT MessageFactory
|
||||
: public LtsWebSocket::AbstractClientMessageFactory
|
||||
class LTSPROJECTIONWORKSTATION_EXPORT MessageFactory : public LtsWebSocket::AbstractClientMessageFactory
|
||||
{
|
||||
|
||||
public:
|
||||
MessageFactory(AbstractMessageHandler *handler, LOGGER_T &logger)
|
||||
: LtsWebSocket::AbstractClientMessageFactory(logger)
|
||||
, m_handler(handler)
|
||||
{}
|
||||
public:
|
||||
MessageFactory(AbstractMessageHandler* handler, LOGGER_T& logger)
|
||||
: LtsWebSocket::AbstractClientMessageFactory(logger), m_handler(handler)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
LtsWebSocket::AbstractClientMessage *createMessage(LtsWebSocket::ReplyHandler *client, const QString &message) override final;
|
||||
LtsWebSocket::AbstractClientMessage* createMessage(LtsWebSocket::ReplyHandler* client,
|
||||
const QString& message) override final;
|
||||
|
||||
private:
|
||||
AbstractMessageHandler *m_handler;
|
||||
private:
|
||||
AbstractMessageHandler* m_handler;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace LtsProjectionWorkstation
|
||||
Executable → Regular
+133
-138
@@ -1,210 +1,205 @@
|
||||
|
||||
|
||||
|
||||
#include "messages.h"
|
||||
|
||||
#include <QJsonArray>
|
||||
#include <QDebug>
|
||||
#include <QJsonArray>
|
||||
|
||||
namespace LtsProjectionWorkstation
|
||||
{
|
||||
|
||||
|
||||
STC::LoginRequestReply::LoginRequestReply(const QString &uuid, Reason reason, int reasonUserId, const QVector<VncScreen> &screens)
|
||||
: Message(nullptr, nullptr, JsonKeys::LOGIN_REPLY(), uuid, QJsonValue())
|
||||
, m_screens(screens)
|
||||
, m_reasonUserId(reasonUserId)
|
||||
, m_reason(reason)
|
||||
STC::LoginRequestReply::LoginRequestReply(const QString& uuid, Reason reason, int reasonUserId,
|
||||
const QVector<VncScreen>& screens)
|
||||
: Message(nullptr, nullptr, JsonKeys::LOGIN_REPLY(), uuid, QJsonValue()), m_screens(screens),
|
||||
m_reasonUserId(reasonUserId), m_reason(reason)
|
||||
{
|
||||
QJsonObject result;
|
||||
QJsonArray arr;
|
||||
for (const VncScreen &vncScreen : screens)
|
||||
{
|
||||
QJsonObject screen;
|
||||
screen.insert(JsonKeys::NAME(), vncScreen.name);
|
||||
screen.insert(JsonKeys::PORT(), vncScreen.port);
|
||||
screen.insert(JsonKeys::WIDTH(), vncScreen.geometry.width());
|
||||
screen.insert(JsonKeys::HEIGHT(), vncScreen.geometry.height());
|
||||
arr.append(screen);
|
||||
}
|
||||
result.insert(JsonKeys::REASON(), reason);
|
||||
result.insert(JsonKeys::USER_ID(), reasonUserId);
|
||||
result.insert(JsonKeys::SCREENS(), arr);
|
||||
m_replyData = QJsonValue(result);
|
||||
QJsonObject result;
|
||||
QJsonArray arr;
|
||||
for (const VncScreen& vncScreen : screens)
|
||||
{
|
||||
QJsonObject screen;
|
||||
screen.insert(JsonKeys::NAME(), vncScreen.name);
|
||||
screen.insert(JsonKeys::PORT(), vncScreen.port);
|
||||
screen.insert(JsonKeys::WIDTH(), vncScreen.geometry.width());
|
||||
screen.insert(JsonKeys::HEIGHT(), vncScreen.geometry.height());
|
||||
arr.append(screen);
|
||||
}
|
||||
result.insert(JsonKeys::REASON(), reason);
|
||||
result.insert(JsonKeys::USER_ID(), reasonUserId);
|
||||
result.insert(JsonKeys::SCREENS(), arr);
|
||||
m_replyData = QJsonValue(result);
|
||||
}
|
||||
|
||||
|
||||
void STC::LoginRequestReply::process()
|
||||
{
|
||||
if (!m_handler || !m_client) return;
|
||||
QJsonObject dataObj = m_data.toObject();
|
||||
m_reason = Reason(dataObj.value(JsonKeys::REASON()).toInt());
|
||||
m_reasonUserId = dataObj.value(JsonKeys::USER_ID()).toInt();
|
||||
const auto arr = dataObj.value(JsonKeys::SCREENS()).toArray();
|
||||
for (const QJsonValue &val : arr)
|
||||
{
|
||||
const QJsonObject obj(val.toObject());
|
||||
VncScreen screen;
|
||||
screen.name = obj.value(JsonKeys::NAME()).toString(QStringLiteral("err"));
|
||||
screen.port = obj.value(JsonKeys::PORT()).toInt(-1);
|
||||
screen.geometry = QRect(0, 0,
|
||||
obj.value(JsonKeys::WIDTH()).toInt(-1),
|
||||
obj.value(JsonKeys::HEIGHT()).toInt(-1));
|
||||
m_screens.append(std::move(screen));
|
||||
}
|
||||
m_handler->handleMessage(this);
|
||||
if (!m_handler || !m_client)
|
||||
return;
|
||||
QJsonObject dataObj = m_data.toObject();
|
||||
m_reason = Reason(dataObj.value(JsonKeys::REASON()).toInt());
|
||||
m_reasonUserId = dataObj.value(JsonKeys::USER_ID()).toInt();
|
||||
const auto arr = dataObj.value(JsonKeys::SCREENS()).toArray();
|
||||
for (const QJsonValue& val : arr)
|
||||
{
|
||||
const QJsonObject obj(val.toObject());
|
||||
VncScreen screen;
|
||||
screen.name = obj.value(JsonKeys::NAME()).toString(QStringLiteral("err"));
|
||||
screen.port = obj.value(JsonKeys::PORT()).toInt(-1);
|
||||
screen.geometry = QRect(0, 0, obj.value(JsonKeys::WIDTH()).toInt(-1), obj.value(JsonKeys::HEIGHT()).toInt(-1));
|
||||
m_screens.append(std::move(screen));
|
||||
}
|
||||
m_handler->handleMessage(this);
|
||||
}
|
||||
|
||||
|
||||
bool STC::LoginRequestReply::hasValidData() const
|
||||
{
|
||||
if (!m_handler || !m_client) return false;
|
||||
QJsonObject obj = m_data.toObject();
|
||||
if (obj.value(JsonKeys::REASON()).isUndefined()) return false;
|
||||
if (obj.value(JsonKeys::USER_ID()).isUndefined()) return false;
|
||||
if (obj.value(JsonKeys::SCREENS()).isUndefined()) return false;
|
||||
return true;
|
||||
if (!m_handler || !m_client)
|
||||
return false;
|
||||
QJsonObject obj = m_data.toObject();
|
||||
if (obj.value(JsonKeys::REASON()).isUndefined())
|
||||
return false;
|
||||
if (obj.value(JsonKeys::USER_ID()).isUndefined())
|
||||
return false;
|
||||
if (obj.value(JsonKeys::SCREENS()).isUndefined())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
STC::DedicatedDisconnect::DedicatedDisconnect(const QString &uuid, int userId)
|
||||
: Message(nullptr, nullptr, JsonKeys::DEDICAED_DISCONNECT(), uuid, QJsonValue())
|
||||
, m_userId(userId)
|
||||
STC::DedicatedDisconnect::DedicatedDisconnect(const QString& uuid, int userId)
|
||||
: Message(nullptr, nullptr, JsonKeys::DEDICAED_DISCONNECT(), uuid, QJsonValue()), m_userId(userId)
|
||||
{
|
||||
QJsonObject result;
|
||||
result.insert(JsonKeys::USER_ID(), m_userId);
|
||||
m_replyData = result;
|
||||
QJsonObject result;
|
||||
result.insert(JsonKeys::USER_ID(), m_userId);
|
||||
m_replyData = result;
|
||||
}
|
||||
|
||||
|
||||
void STC::DedicatedDisconnect::process()
|
||||
{
|
||||
if (!m_handler || !m_client) return;
|
||||
QJsonObject obj = m_data.toObject();
|
||||
m_userId = obj.value(JsonKeys::USER_ID()).toInt(-1);
|
||||
m_handler->handleMessage(this);
|
||||
if (!m_handler || !m_client)
|
||||
return;
|
||||
QJsonObject obj = m_data.toObject();
|
||||
m_userId = obj.value(JsonKeys::USER_ID()).toInt(-1);
|
||||
m_handler->handleMessage(this);
|
||||
}
|
||||
|
||||
|
||||
bool STC::DedicatedDisconnect::hasValidData() const
|
||||
{
|
||||
if (!m_handler || !m_client) return false;
|
||||
QJsonObject obj = m_data.toObject();
|
||||
if (obj.value(JsonKeys::USER_ID()).isUndefined()) return false;
|
||||
return true;
|
||||
if (!m_handler || !m_client)
|
||||
return false;
|
||||
QJsonObject obj = m_data.toObject();
|
||||
if (obj.value(JsonKeys::USER_ID()).isUndefined())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
CTS::LoginRequest::LoginRequest(const QString &uuid, int userId, int priority, int exerciseId, const QByteArray &settingsData)
|
||||
: Message(nullptr, nullptr, JsonKeys::LOGIN_REQUEST(), uuid, QJsonValue())
|
||||
, m_settingsData(settingsData), m_userId(userId), m_priority(priority), m_exerciseId(exerciseId)
|
||||
CTS::LoginRequest::LoginRequest(const QString& uuid, int userId, int priority, int exerciseId,
|
||||
const QByteArray& settingsData)
|
||||
: Message(nullptr, nullptr, JsonKeys::LOGIN_REQUEST(), uuid, QJsonValue()), m_settingsData(settingsData),
|
||||
m_userId(userId), m_priority(priority), m_exerciseId(exerciseId)
|
||||
{
|
||||
QJsonObject result;
|
||||
result.insert(JsonKeys::USER_ID(), m_userId);
|
||||
result.insert(JsonKeys::USER_PRIORITY(), m_priority);
|
||||
result.insert(JsonKeys::EXERCISE_ID(), m_exerciseId);
|
||||
result.insert(JsonKeys::SETTINGS_DATA(), QString::fromLatin1(m_settingsData.toBase64()));
|
||||
m_replyData = result;
|
||||
QJsonObject result;
|
||||
result.insert(JsonKeys::USER_ID(), m_userId);
|
||||
result.insert(JsonKeys::USER_PRIORITY(), m_priority);
|
||||
result.insert(JsonKeys::EXERCISE_ID(), m_exerciseId);
|
||||
result.insert(JsonKeys::SETTINGS_DATA(), QString::fromLatin1(m_settingsData.toBase64()));
|
||||
m_replyData = result;
|
||||
}
|
||||
|
||||
|
||||
void CTS::LoginRequest::process()
|
||||
{
|
||||
if (!m_handler || !m_client) return;
|
||||
QJsonObject obj = m_data.toObject();
|
||||
m_userId = obj.value(JsonKeys::USER_ID()).toInt(-1);
|
||||
m_priority = obj.value(JsonKeys::USER_PRIORITY()).toInt(-1);
|
||||
m_exerciseId = obj.value(JsonKeys::EXERCISE_ID()).toInt(-1);
|
||||
m_settingsData = QByteArray::fromBase64(obj.value(JsonKeys::SETTINGS_DATA()).toString().toLatin1());
|
||||
m_handler->handleMessage(this);
|
||||
if (!m_handler || !m_client)
|
||||
return;
|
||||
QJsonObject obj = m_data.toObject();
|
||||
m_userId = obj.value(JsonKeys::USER_ID()).toInt(-1);
|
||||
m_priority = obj.value(JsonKeys::USER_PRIORITY()).toInt(-1);
|
||||
m_exerciseId = obj.value(JsonKeys::EXERCISE_ID()).toInt(-1);
|
||||
m_settingsData = QByteArray::fromBase64(obj.value(JsonKeys::SETTINGS_DATA()).toString().toLatin1());
|
||||
m_handler->handleMessage(this);
|
||||
}
|
||||
|
||||
|
||||
bool CTS::LoginRequest::hasValidData() const
|
||||
{
|
||||
if (!m_handler || !m_client) return false;
|
||||
QJsonObject obj = m_data.toObject();
|
||||
if (obj.value(JsonKeys::USER_ID()).isUndefined()) return false;
|
||||
if (obj.value(JsonKeys::EXERCISE_ID()).isUndefined()) return false;
|
||||
if (obj.value(JsonKeys::USER_PRIORITY()).isUndefined()) return false;
|
||||
if (obj.value(JsonKeys::SETTINGS_DATA()).isUndefined()) return false;
|
||||
return true;
|
||||
if (!m_handler || !m_client)
|
||||
return false;
|
||||
QJsonObject obj = m_data.toObject();
|
||||
if (obj.value(JsonKeys::USER_ID()).isUndefined())
|
||||
return false;
|
||||
if (obj.value(JsonKeys::EXERCISE_ID()).isUndefined())
|
||||
return false;
|
||||
if (obj.value(JsonKeys::USER_PRIORITY()).isUndefined())
|
||||
return false;
|
||||
if (obj.value(JsonKeys::SETTINGS_DATA()).isUndefined())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CTS::LogoutRequest::process()
|
||||
{
|
||||
if (!m_handler || !m_client) return;
|
||||
m_handler->handleMessage(this);
|
||||
if (!m_handler || !m_client)
|
||||
return;
|
||||
m_handler->handleMessage(this);
|
||||
}
|
||||
|
||||
|
||||
bool CTS::LogoutRequest::hasValidData() const
|
||||
{
|
||||
if (!m_handler || !m_client) return false;
|
||||
return true;
|
||||
if (!m_handler || !m_client)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
CTS::DisconnectRequest::DisconnectRequest(const QString &uuid, int userId)
|
||||
: Message(nullptr, nullptr, JsonKeys::DISCONNECT_REQUEST(), uuid, QJsonValue())
|
||||
, m_userId(userId)
|
||||
CTS::DisconnectRequest::DisconnectRequest(const QString& uuid, int userId)
|
||||
: Message(nullptr, nullptr, JsonKeys::DISCONNECT_REQUEST(), uuid, QJsonValue()), m_userId(userId)
|
||||
{
|
||||
qDebug() << " 1 m_userId = " << m_userId;
|
||||
QJsonObject result;
|
||||
result.insert(JsonKeys::USER_ID(), m_userId);
|
||||
m_replyData = result;
|
||||
qDebug() << " 1 m_userId = " << m_userId;
|
||||
QJsonObject result;
|
||||
result.insert(JsonKeys::USER_ID(), m_userId);
|
||||
m_replyData = result;
|
||||
}
|
||||
|
||||
void CTS::DisconnectRequest::process()
|
||||
{
|
||||
if (!m_handler || !m_client) return;
|
||||
QJsonObject obj = m_data.toObject();
|
||||
m_userId = obj.value(JsonKeys::USER_ID()).toInt(-1);
|
||||
qDebug() << " 2 m_userId = " << m_userId;
|
||||
m_handler->handleMessage(this);
|
||||
if (!m_handler || !m_client)
|
||||
return;
|
||||
QJsonObject obj = m_data.toObject();
|
||||
m_userId = obj.value(JsonKeys::USER_ID()).toInt(-1);
|
||||
qDebug() << " 2 m_userId = " << m_userId;
|
||||
m_handler->handleMessage(this);
|
||||
}
|
||||
|
||||
bool CTS::DisconnectRequest::hasValidData() const
|
||||
{
|
||||
if (!m_handler || !m_client) return false;
|
||||
QJsonObject obj = m_data.toObject();
|
||||
if (obj.value(JsonKeys::USER_ID()).isUndefined()) return false;
|
||||
return true;
|
||||
if (!m_handler || !m_client)
|
||||
return false;
|
||||
QJsonObject obj = m_data.toObject();
|
||||
if (obj.value(JsonKeys::USER_ID()).isUndefined())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
ErrorMessage::ErrorMessage(const QString &uuid, const QString &reason)
|
||||
: Message(nullptr, nullptr, JsonKeys::ERROR_MESSAGE(), uuid, QJsonValue())
|
||||
, m_reason(reason)
|
||||
ErrorMessage::ErrorMessage(const QString& uuid, const QString& reason)
|
||||
: Message(nullptr, nullptr, JsonKeys::ERROR_MESSAGE(), uuid, QJsonValue()), m_reason(reason)
|
||||
{
|
||||
QJsonObject result;
|
||||
result.insert(JsonKeys::REASON(), m_reason);
|
||||
m_replyData = result;
|
||||
QJsonObject result;
|
||||
result.insert(JsonKeys::REASON(), m_reason);
|
||||
m_replyData = result;
|
||||
}
|
||||
|
||||
|
||||
void ErrorMessage::process()
|
||||
{
|
||||
if (!m_handler || !m_client) return;
|
||||
QJsonObject obj = m_data.toObject();
|
||||
m_reason = obj.value(JsonKeys::REASON()).toString(QStringLiteral("err"));
|
||||
m_handler->handleMessage(this);
|
||||
if (!m_handler || !m_client)
|
||||
return;
|
||||
QJsonObject obj = m_data.toObject();
|
||||
m_reason = obj.value(JsonKeys::REASON()).toString(QStringLiteral("err"));
|
||||
m_handler->handleMessage(this);
|
||||
}
|
||||
|
||||
|
||||
bool ErrorMessage::hasValidData() const
|
||||
{
|
||||
if (!m_handler || !m_client) return false;
|
||||
QJsonObject obj = m_data.toObject();
|
||||
if (obj.value(JsonKeys::REASON()).isUndefined()) return false;
|
||||
return true;
|
||||
if (!m_handler || !m_client)
|
||||
return false;
|
||||
QJsonObject obj = m_data.toObject();
|
||||
if (obj.value(JsonKeys::REASON()).isUndefined())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} // namespace LtsProjectionWorkstation
|
||||
Executable → Regular
+138
-121
@@ -1,192 +1,209 @@
|
||||
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "json_keys.h"
|
||||
|
||||
#include <LtsWebSocket/json_keys.h>
|
||||
#include <LtsWebSocket/client_message.h>
|
||||
|
||||
#include "ltsprojectionworkstation_export.h"
|
||||
#include <LtsProjectionWorkstation/vnc_server_manager.h>
|
||||
|
||||
#include <LtsProjectionWorkstation/vnc_server_manager.h>
|
||||
#include <LtsWebSocket/client_message.h>
|
||||
#include <LtsWebSocket/json_keys.h>
|
||||
#include <QVector>
|
||||
|
||||
namespace LtsWebSocket { class ReplyHandler; }
|
||||
namespace LtsWebSocket
|
||||
{
|
||||
class ReplyHandler;
|
||||
}
|
||||
|
||||
namespace LtsProjectionWorkstation
|
||||
{
|
||||
|
||||
class AbstractMessageHandler
|
||||
{
|
||||
public:
|
||||
virtual ~AbstractMessageHandler() = default;
|
||||
virtual void handleMessage(LtsWebSocket::AbstractClientMessage *message) = 0;
|
||||
public:
|
||||
virtual ~AbstractMessageHandler() = default;
|
||||
virtual void handleMessage(LtsWebSocket::AbstractClientMessage* message) = 0;
|
||||
};
|
||||
|
||||
|
||||
class Reply : public LtsWebSocket::ReplyMessage
|
||||
{
|
||||
public:
|
||||
Reply(const QString &type, const int typeId, const QString &uuid, const QJsonObject &data)
|
||||
: LtsWebSocket::ReplyMessage(type, typeId, uuid)
|
||||
{
|
||||
m_jsonRepresentation.insert(LtsWebSocket::JsonKeys::DATA(), data);
|
||||
}
|
||||
public:
|
||||
Reply(const QString& type, const int typeId, const QString& uuid, const QJsonObject& data)
|
||||
: LtsWebSocket::ReplyMessage(type, typeId, uuid)
|
||||
{
|
||||
m_jsonRepresentation.insert(LtsWebSocket::JsonKeys::DATA(), data);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class Message : public LtsWebSocket::AbstractClientMessage
|
||||
{
|
||||
public:
|
||||
Message(AbstractMessageHandler *handler, LtsWebSocket::ReplyHandler *client, const QString &type, const QString &uuid, const QJsonValue &data = QJsonValue())
|
||||
: LtsWebSocket::AbstractClientMessage(client, type, 1, uuid, data)
|
||||
, m_handler(handler)
|
||||
{}
|
||||
public:
|
||||
Message(AbstractMessageHandler* handler, LtsWebSocket::ReplyHandler* client, const QString& type,
|
||||
const QString& uuid, const QJsonValue& data = QJsonValue())
|
||||
: LtsWebSocket::AbstractClientMessage(client, type, 1, uuid, data), m_handler(handler)
|
||||
{
|
||||
}
|
||||
|
||||
LtsWebSocket::ReplyMessage *toReplyMessage() const
|
||||
{
|
||||
if (!m_handler || !m_client)
|
||||
return new Reply(m_type, m_typeId, m_uuid, m_replyData.toObject());
|
||||
return nullptr;
|
||||
}
|
||||
LtsWebSocket::ReplyMessage* toReplyMessage() const
|
||||
{
|
||||
if (!m_handler || !m_client)
|
||||
return new Reply(m_type, m_typeId, m_uuid, m_replyData.toObject());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void addReply(LtsWebSocket::ReplyMessage *reply)
|
||||
{
|
||||
if (m_client)
|
||||
m_client->addReply(reply);
|
||||
}
|
||||
|
||||
protected:
|
||||
AbstractMessageHandler *m_handler;
|
||||
QJsonValue m_replyData;
|
||||
|
||||
};
|
||||
void addReply(LtsWebSocket::ReplyMessage* reply)
|
||||
{
|
||||
if (m_client)
|
||||
m_client->addReply(reply);
|
||||
}
|
||||
|
||||
protected:
|
||||
AbstractMessageHandler* m_handler;
|
||||
QJsonValue m_replyData;
|
||||
};
|
||||
|
||||
class LTSPROJECTIONWORKSTATION_EXPORT ErrorMessage : public Message
|
||||
{
|
||||
public:
|
||||
using Message::Message;
|
||||
ErrorMessage(const QString &uuid, const QString &reason);
|
||||
public:
|
||||
using Message::Message;
|
||||
ErrorMessage(const QString& uuid, const QString& reason);
|
||||
|
||||
|
||||
void process() override final;
|
||||
bool hasValidData() const override final;
|
||||
void process() override final;
|
||||
bool hasValidData() const override final;
|
||||
|
||||
private:
|
||||
QString m_reason;
|
||||
private:
|
||||
QString m_reason;
|
||||
};
|
||||
|
||||
namespace STC
|
||||
namespace STC
|
||||
{
|
||||
|
||||
class LTSPROJECTIONWORKSTATION_EXPORT LoginRequestReply : public Message
|
||||
{
|
||||
public:
|
||||
enum Reason
|
||||
{
|
||||
LoginSuccessful,
|
||||
OtherUser,
|
||||
};
|
||||
public:
|
||||
enum Reason {
|
||||
LoginSuccessful,
|
||||
OtherUser,
|
||||
};
|
||||
|
||||
using Message::Message;
|
||||
LoginRequestReply(const QString &uuid, Reason reason, int reasonUserId, const QVector<VncScreen> &screens);
|
||||
using Message::Message;
|
||||
LoginRequestReply(const QString& uuid, Reason reason, int reasonUserId, const QVector<VncScreen>& screens);
|
||||
|
||||
|
||||
void process() override final;
|
||||
bool hasValidData() const override final;
|
||||
void process() override final;
|
||||
bool hasValidData() const override final;
|
||||
|
||||
int reasonUserId() const { return m_reasonUserId; }
|
||||
Reason reason() const { return m_reason; }
|
||||
const QVector<VncScreen> &screens() const { return m_screens; }
|
||||
int reasonUserId() const
|
||||
{
|
||||
return m_reasonUserId;
|
||||
}
|
||||
|
||||
private:
|
||||
QVector<VncScreen> m_screens;
|
||||
int m_reasonUserId = -1;
|
||||
Reason m_reason = LoginSuccessful;
|
||||
};
|
||||
Reason reason() const
|
||||
{
|
||||
return m_reason;
|
||||
}
|
||||
|
||||
const QVector<VncScreen>& screens() const
|
||||
{
|
||||
return m_screens;
|
||||
}
|
||||
|
||||
private:
|
||||
QVector<VncScreen> m_screens;
|
||||
int m_reasonUserId = -1;
|
||||
Reason m_reason = LoginSuccessful;
|
||||
};
|
||||
|
||||
class LTSPROJECTIONWORKSTATION_EXPORT DedicatedDisconnect : public Message
|
||||
{
|
||||
public:
|
||||
using Message::Message;
|
||||
DedicatedDisconnect(const QString &uuid, int userId);
|
||||
public:
|
||||
using Message::Message;
|
||||
DedicatedDisconnect(const QString& uuid, int userId);
|
||||
|
||||
|
||||
void process() override final;
|
||||
bool hasValidData() const override final;
|
||||
void process() override final;
|
||||
bool hasValidData() const override final;
|
||||
|
||||
int userid() const { return m_userId; }
|
||||
int userid() const
|
||||
{
|
||||
return m_userId;
|
||||
}
|
||||
|
||||
private:
|
||||
int m_userId = -1;
|
||||
private:
|
||||
int m_userId = -1;
|
||||
};
|
||||
|
||||
};
|
||||
} // namespace STC
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
namespace CTS
|
||||
namespace CTS
|
||||
{
|
||||
|
||||
class LTSPROJECTIONWORKSTATION_EXPORT LoginRequest : public Message
|
||||
{
|
||||
public:
|
||||
using Message::Message;
|
||||
LoginRequest(const QString &uuid, int userId, int priority, int exerciseId, const QByteArray &settingsData);
|
||||
public:
|
||||
using Message::Message;
|
||||
LoginRequest(const QString& uuid, int userId, int priority, int exerciseId, const QByteArray& settingsData);
|
||||
|
||||
|
||||
void process() override final;
|
||||
bool hasValidData() const override final;
|
||||
void process() override final;
|
||||
bool hasValidData() const override final;
|
||||
|
||||
int userId() const { return m_userId; }
|
||||
int priority() const { return m_priority; }
|
||||
int exerciseId() const { return m_exerciseId; }
|
||||
const QByteArray &settingsData() const { return m_settingsData; }
|
||||
int userId() const
|
||||
{
|
||||
return m_userId;
|
||||
}
|
||||
|
||||
private:
|
||||
QByteArray m_settingsData;
|
||||
int m_userId = 0;
|
||||
int m_priority = 0;
|
||||
int m_exerciseId = 0;
|
||||
int priority() const
|
||||
{
|
||||
return m_priority;
|
||||
}
|
||||
|
||||
};
|
||||
int exerciseId() const
|
||||
{
|
||||
return m_exerciseId;
|
||||
}
|
||||
|
||||
const QByteArray& settingsData() const
|
||||
{
|
||||
return m_settingsData;
|
||||
}
|
||||
|
||||
private:
|
||||
QByteArray m_settingsData;
|
||||
int m_userId = 0;
|
||||
int m_priority = 0;
|
||||
int m_exerciseId = 0;
|
||||
};
|
||||
|
||||
class LTSPROJECTIONWORKSTATION_EXPORT LogoutRequest : public Message
|
||||
{
|
||||
public:
|
||||
using Message::Message;
|
||||
explicit LogoutRequest(const QString &uuid)
|
||||
: Message(nullptr, nullptr, JsonKeys::LOGOUT_REQUEST(), uuid, QJsonValue())
|
||||
{}
|
||||
public:
|
||||
using Message::Message;
|
||||
|
||||
|
||||
void process() override final;
|
||||
bool hasValidData() const override final;
|
||||
|
||||
};
|
||||
explicit LogoutRequest(const QString& uuid)
|
||||
: Message(nullptr, nullptr, JsonKeys::LOGOUT_REQUEST(), uuid, QJsonValue())
|
||||
{
|
||||
}
|
||||
|
||||
void process() override final;
|
||||
bool hasValidData() const override final;
|
||||
};
|
||||
|
||||
class LTSPROJECTIONWORKSTATION_EXPORT DisconnectRequest : public Message
|
||||
{
|
||||
public:
|
||||
using Message::Message;
|
||||
explicit DisconnectRequest(const QString &uuid, int userId);
|
||||
public:
|
||||
using Message::Message;
|
||||
explicit DisconnectRequest(const QString& uuid, int userId);
|
||||
|
||||
|
||||
void process() override final;
|
||||
bool hasValidData() const override final;
|
||||
void process() override final;
|
||||
bool hasValidData() const override final;
|
||||
|
||||
int userId() const { return m_userId; }
|
||||
private:
|
||||
int m_userId{0};
|
||||
int userId() const
|
||||
{
|
||||
return m_userId;
|
||||
}
|
||||
|
||||
};
|
||||
private:
|
||||
int m_userId{0};
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace CTS
|
||||
|
||||
}
|
||||
} // namespace LtsProjectionWorkstation
|
||||
Executable → Regular
+7
-8
@@ -1,21 +1,20 @@
|
||||
|
||||
|
||||
|
||||
#include "reply_message.h"
|
||||
|
||||
namespace LtsProjectionWorkstation
|
||||
{
|
||||
|
||||
LoginReply::LoginReply(const QJsonObject &data, const QString &uuid)
|
||||
: LtsWebSocket::ReplyMessage(JsonKeys::LOGIN_REPLY(), uuid)
|
||||
LoginReply::LoginReply(const QJsonObject& data, const QString& uuid)
|
||||
: LtsWebSocket::ReplyMessage(JsonKeys::LOGIN_REPLY(), uuid)
|
||||
{
|
||||
m_jsonRepresentation.insert(LtsWebSocket::JsonKeys::DATA(), data);
|
||||
m_jsonRepresentation.insert(LtsWebSocket::JsonKeys::DATA(), data);
|
||||
}
|
||||
|
||||
LogoutReply::LogoutReply(const QJsonObject &data, const QString &uuid)
|
||||
: LtsWebSocket::ReplyMessage(JsonKeys::LOGOUT_REPLY(), uuid)
|
||||
LogoutReply::LogoutReply(const QJsonObject& data, const QString& uuid)
|
||||
: LtsWebSocket::ReplyMessage(JsonKeys::LOGOUT_REPLY(), uuid)
|
||||
{
|
||||
m_jsonRepresentation.insert(LtsWebSocket::JsonKeys::DATA(), data);
|
||||
m_jsonRepresentation.insert(LtsWebSocket::JsonKeys::DATA(), data);
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace LtsProjectionWorkstation
|
||||
Executable → Regular
+8
-9
@@ -1,24 +1,23 @@
|
||||
|
||||
|
||||
|
||||
#include "json_keys.h"
|
||||
|
||||
#include <LtsWebSocket/reply_message.h>
|
||||
#include <LtsWebSocket/json_keys.h>
|
||||
#include <LtsWebSocket/reply_message.h>
|
||||
|
||||
namespace LtsProjectionWorkstation
|
||||
{
|
||||
|
||||
class LoginReply : public LtsWebSocket::ReplyMessage
|
||||
{
|
||||
public:
|
||||
explicit LoginReply(const QJsonObject &data, const QString &uuid);
|
||||
};
|
||||
public:
|
||||
explicit LoginReply(const QJsonObject& data, const QString& uuid);
|
||||
};
|
||||
|
||||
class LogoutReply : public LtsWebSocket::ReplyMessage
|
||||
{
|
||||
public:
|
||||
explicit LogoutReply(const QJsonObject &data, const QString &uuid);
|
||||
};
|
||||
public:
|
||||
explicit LogoutReply(const QJsonObject& data, const QString& uuid);
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace LtsProjectionWorkstation
|
||||
Reference in new issue
Block a user