43 lines
1.3 KiB
C++
43 lines
1.3 KiB
C++
#include "api_v1_Devices.h"
|
|
using namespace api::v1;
|
|
//add definition of your processing function here
|
|
|
|
void Devices::get_all(const HttpRequestPtr &req, std::function<void(const HttpResponsePtr &)> &&callback)
|
|
{
|
|
|
|
std::cout << "Get All\n";
|
|
|
|
auto resp=HttpResponse::newHttpResponse();
|
|
callback(resp);
|
|
}
|
|
|
|
void Devices::get_one(const HttpRequestPtr &req, std::function<void(const HttpResponsePtr &)> &&callback,
|
|
std::string device_id)
|
|
{
|
|
std::cout << "Get One: " << device_id << "\n";
|
|
|
|
auto resp=HttpResponse::newHttpResponse();
|
|
callback(resp);
|
|
}
|
|
|
|
void Devices::get_relays_all(const HttpRequestPtr &req, std::function<void(const HttpResponsePtr &)> &&callback,
|
|
std::string device_id)
|
|
{
|
|
std::cout << "Get Relays All: " << device_id << "\n";
|
|
|
|
auto resp=HttpResponse::newHttpResponse();
|
|
callback(resp);
|
|
}
|
|
|
|
void Devices::get_relays_one(const HttpRequestPtr &req, std::function<void(const HttpResponsePtr &)> &&callback,
|
|
std::string device_id, std::string relay_id)
|
|
{
|
|
std::cout << "Get Relays One: " << device_id << "; " << relay_id << "\n";
|
|
|
|
Json::Value ret;
|
|
ret["result"] = "ok";
|
|
ret["device_id"] = device_id;
|
|
ret["relay_id"] = relay_id;
|
|
auto resp = HttpResponse::newHttpJsonResponse(ret);
|
|
callback(resp);
|
|
}
|