added new web controller for knowing the version of the web api

This commit is contained in:
Luis Ángel San Martín
2016-01-23 16:06:47 +01:00
parent 09e8062a9a
commit 1009b84363
5 changed files with 70 additions and 16 deletions

View File

@ -0,0 +1,10 @@
#include "versioncontroller.h"
VersionController::VersionController() {}
void VersionController::service(HttpRequest& request, HttpResponse& response)
{
Q_UNUSED(request);
response.writeText(SERVER_VERSION_NUMBER,true);
}

View File

@ -0,0 +1,21 @@
#ifndef VERSIONCONTROLLER_H
#define VERSIONCONTROLLER_H
#include "httprequest.h"
#include "httpresponse.h"
#include "httprequesthandler.h"
#include <QThread>
class VersionController : public HttpRequestHandler {
Q_OBJECT
Q_DISABLE_COPY(VersionController);
public:
/** Constructor */
VersionController();
/** Generates the response */
void service(HttpRequest& request, HttpResponse& response);
};
#endif // VERSIONCONTROLLER_H