diff --git a/helloworldapplication.cpp b/helloworldapplication.cpp new file mode 100644 index 0000000..a40842e --- /dev/null +++ b/helloworldapplication.cpp @@ -0,0 +1,12 @@ +#include "helloworldapplication.h" + +HelloWorldApplication::HelloWorldApplication(const QJsonObject &config, QObject *parent) : + WebApplication(parent) +{ + +} + +void HelloWorldApplication::start() +{ + +} diff --git a/helloworldapplication.h b/helloworldapplication.h new file mode 100644 index 0000000..3688e19 --- /dev/null +++ b/helloworldapplication.h @@ -0,0 +1,15 @@ +#pragma once + +#include "webapplication.h" + +class QJsonObject; + +class HelloWorldApplication : public WebApplication +{ + Q_OBJECT + +public: + HelloWorldApplication(const QJsonObject &config, QObject *parent = Q_NULLPTR); + + void start() Q_DECL_OVERRIDE; +}; diff --git a/helloworldplugin.cpp b/helloworldplugin.cpp new file mode 100644 index 0000000..b458230 --- /dev/null +++ b/helloworldplugin.cpp @@ -0,0 +1,20 @@ +#include "helloworldplugin.h" + +#include "helloworldapplication.h" + +HelloWorldPlugin::HelloWorldPlugin(QObject *parent) : + WebPlugin(parent) +{ + +} + +QString HelloWorldPlugin::pluginName() const +{ + return QStringLiteral("helloworld"); +} + +WebApplication *HelloWorldPlugin::createApplication(const QJsonObject &config) const +{ + return new HelloWorldApplication(config); +} + diff --git a/helloworldplugin.h b/helloworldplugin.h new file mode 100644 index 0000000..2a6cc62 --- /dev/null +++ b/helloworldplugin.h @@ -0,0 +1,16 @@ +#pragma once + +#include "webplugin.h" + +class HelloWorldPlugin : public WebPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "dbsoftware.webserver.plugin/1.0" FILE "helloworldplugin.json") + Q_INTERFACES(WebPlugin) + +public: + HelloWorldPlugin(QObject *parent = Q_NULLPTR); + + QString pluginName() const Q_DECL_OVERRIDE; + WebApplication *createApplication(const QJsonObject &config) const Q_DECL_OVERRIDE; +}; diff --git a/helloworldplugin.json b/helloworldplugin.json new file mode 100644 index 0000000..e69de29 diff --git a/helloworldplugin.pro b/helloworldplugin.pro new file mode 100644 index 0000000..fc1e545 --- /dev/null +++ b/helloworldplugin.pro @@ -0,0 +1,19 @@ +QT += core network + +DBLIBS += webserverlib + +HEADERS += helloworldplugin.h \ + helloworldapplication.h + +SOURCES += helloworldplugin.cpp \ + helloworldapplication.cpp + +FORMS += + +RESOURCES += + +TRANSLATIONS += + +OTHER_FILES += helloworldplugin.json + +include(../plugin.pri)