Refactoring project layout.

This commit is contained in:
stephb9959
2021-10-19 19:16:09 -07:00
parent 8c3a9cb535
commit 98f22b5eb9
81 changed files with 556 additions and 120 deletions

View File

@@ -0,0 +1,28 @@
//
// Created by stephane bourque on 2021-07-18.
//
#include "RESTAPI_connectedDeviceHandler.h"
#include "RESTAPI_FMSObjects.h"
#include "StorageService.h"
#include "framework/RESTAPI_protocol.h"
#include "framework/RESTAPI_errors.h"
namespace OpenWifi {
void RESTAPI_connectedDeviceHandler::DoGet() {
auto SerialNumber = GetBinding(RESTAPI::Protocol::SERIALNUMBER,"");
if(SerialNumber.empty()) {
return BadRequest(RESTAPI::Errors::MissingSerialNumber);
}
FMSObjects::DeviceConnectionInformation DevInfo;
if(Storage()->GetDevice(SerialNumber, DevInfo)) {
Poco::JSON::Object Answer;
DevInfo.to_json(Answer);
return ReturnObject(Answer);
}
NotFound();
}
}