core-legacy/controllers/api_v1_Devices.h
Tobias Reisinger d17500a3b0 Initial commit
2019-07-12 21:05:56 +02:00

24 lines
1 KiB
C++

#pragma once
#include <drogon/HttpController.h>
using namespace drogon;
namespace api
{
namespace v1
{
class Devices:public drogon::HttpController<Devices>
{
public:
METHOD_LIST_BEGIN
METHOD_ADD(Devices::get_all,"/",Get);
METHOD_ADD(Devices::get_one,"/{1}",Get);
METHOD_ADD(Devices::get_relays_all,"/{1}/relays",Get);
METHOD_ADD(Devices::get_relays_one,"/{1}/relays/{2}",Get);
METHOD_LIST_END
void get_all(const HttpRequestPtr& req,std::function<void (const HttpResponsePtr &)> &&callback);
void get_one(const HttpRequestPtr& req,std::function<void (const HttpResponsePtr &)> &&callback,std::string device_id);
void get_relays_all(const HttpRequestPtr& req,std::function<void (const HttpResponsePtr &)> &&callback,std::string device_id);
void get_relays_one(const HttpRequestPtr& req,std::function<void (const HttpResponsePtr &)> &&callback,std::string device_id,std::string relay_id);
};
}
}