From 3d64dc9775e932f209355611ece5d551df87d6bb Mon Sep 17 00:00:00 2001 From: gilio Date: Wed, 29 Aug 2018 10:02:54 -0700 Subject: [PATCH 1/4] HttpRoute: Add constructor for specifying data type --- src/httproute.cpp | 13 +++++++++++++ src/httproute.h | 1 + 2 files changed, 14 insertions(+) diff --git a/src/httproute.cpp b/src/httproute.cpp index e757b358..b7360a15 100644 --- a/src/httproute.cpp +++ b/src/httproute.cpp @@ -50,6 +50,19 @@ Input::Input(const QString& inputname, const std::set& path) : { } +Input::Input(const QString& inputname, const QString& dataType, const std::set& paths) : + name(inputname), + description(), + isRequired(false), + paramType("query"), + dataType(dataType), + values(), + visibility(Visibility::Show), + paths(paths) +{ +} + + Input::Input(const QString& inputname, const QString& desc, const QStringList& vals, const std::set& path) : name(inputname), description(desc), diff --git a/src/httproute.h b/src/httproute.h index 3a342ada..5ffe4fb2 100644 --- a/src/httproute.h +++ b/src/httproute.h @@ -17,6 +17,7 @@ class QTTPSHARED_EXPORT Input Input(Input&& from); Input(const Input& from); Input(const QString& name, const std::set& paths = std::set()); + Input(const QString& name, const QString& dataType, const std::set& paths = std::set()); Input(const QString& name, const QString& desc, const QStringList& values, const std::set& paths = std::set()); Input& operator=(const Input& from); From ab066e65122775049c96c78356c8b6e3dc099e0a Mon Sep 17 00:00:00 2001 From: gilio Date: Wed, 29 Aug 2018 10:03:46 -0700 Subject: [PATCH 2/4] HttpServer: Add and register action with generic parameter --- src/httpserver.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/httpserver.h b/src/httpserver.h index e0177637..fa41eb62 100644 --- a/src/httpserver.h +++ b/src/httpserver.h @@ -155,6 +155,19 @@ class QTTPSHARED_EXPORT HttpServer : public QObject return action; } + template std::shared_ptr addActionAndRegister(P& param, + Visibility visibilty = Visibility::Show) + { + std::shared_ptr action(new T(param)); + HttpServer::addAction(action); + auto routes = action->getRoutes(); + for(const auto & path : routes) + { + HttpServer::registerRoute(action, path, visibilty); + } + return action; + } + /** * @brief A template method to register a processor via the Processor interface. */ From 51677e89865d9286bf3ece4fa40ef60b4117ccf7 Mon Sep 17 00:00:00 2001 From: Ryan Gilio Date: Thu, 13 Sep 2018 12:06:30 -0700 Subject: [PATCH 3/4] Add method to add descriptior to input constructor --- src/httproute.cpp | 13 +++++++++++++ src/httproute.h | 1 + 2 files changed, 14 insertions(+) diff --git a/src/httproute.cpp b/src/httproute.cpp index b7360a15..dd3ebb6a 100644 --- a/src/httproute.cpp +++ b/src/httproute.cpp @@ -62,6 +62,19 @@ Input::Input(const QString& inputname, const QString& dataType, const std::set& paths) : + name(inputname), + description(desc), + isRequired(false), + paramType("query"), + dataType(dataType), + values(), + visibility(Visibility::Show), + paths(paths) +{ +} + + Input::Input(const QString& inputname, const QString& desc, const QStringList& vals, const std::set& path) : name(inputname), diff --git a/src/httproute.h b/src/httproute.h index 5ffe4fb2..c00d1c13 100644 --- a/src/httproute.h +++ b/src/httproute.h @@ -18,6 +18,7 @@ class QTTPSHARED_EXPORT Input Input(const Input& from); Input(const QString& name, const std::set& paths = std::set()); Input(const QString& name, const QString& dataType, const std::set& paths = std::set()); + Input(const QString& name, const QString& dataType, const QString& desc, const std::set& paths = std::set()); Input(const QString& name, const QString& desc, const QStringList& values, const std::set& paths = std::set()); Input& operator=(const Input& from); From f831da44cb5210334f78109f1579d1b4b2f849d7 Mon Sep 17 00:00:00 2001 From: Ryan Gilio Date: Thu, 17 Jan 2019 12:33:05 -0600 Subject: [PATCH 4/4] Remove Validation URL and make swagger url default to base url --- www/index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/www/index.html b/www/index.html index 721c3144..02c91841 100644 --- a/www/index.html +++ b/www/index.html @@ -39,11 +39,12 @@