added get item functionality to http server
This commit is contained in:
@@ -7,8 +7,10 @@
|
||||
|
||||
#include <Poco/Net/HTTPRequestHandler.h>
|
||||
#include <Poco/URI.h>
|
||||
|
||||
#include <Poco/JSON/JSON.h>
|
||||
#include <memory>
|
||||
#include <boost/optional.hpp>
|
||||
#include <Poco/JSON/Object.h>
|
||||
|
||||
#include "output/OutputDriver.h"
|
||||
|
||||
@@ -25,12 +27,12 @@ public:
|
||||
void handleRequest(Poco::Net::HTTPServerRequest &request, Poco::Net::HTTPServerResponse &response) override;
|
||||
|
||||
private:
|
||||
void parseRequest(const std::string& item_type, const std::string& item_name, const std::string& action, const std::string& score = 0);
|
||||
boost::optional<Poco::JSON::Object> parseRequest(const std::string& item_type, const std::string& item_name, const std::string& action, const std::string& score = 0);
|
||||
|
||||
void parseSolenoid(const std::string& item_name, const std::string& action);
|
||||
void parseLamp(const std::string& item_name, const std::string& action);
|
||||
void parseSound(const std::string& item_name, const std::string& action);
|
||||
void parseDisplay(const std::string& item_name, const std::string& action, const std::string& score);
|
||||
boost::optional<Poco::JSON::Object> parseSolenoid(const std::string& item_name, const std::string& action);
|
||||
boost::optional<Poco::JSON::Object> parseLamp(const std::string& item_name, const std::string& action);
|
||||
boost::optional<Poco::JSON::Object> parseSound(const std::string& item_name, const std::string& action);
|
||||
boost::optional<Poco::JSON::Object> parseDisplay(const std::string& item_name, const std::string& action, const std::string& score);
|
||||
|
||||
std::vector<std::string> getPathSegments(Poco::URI uri);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user