mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralfms.git
synced 2025-11-18 19:15:07 +00:00
Refactoring project layout.
This commit is contained in:
28
src/RESTAPI/RESTAPI_connectedDeviceHandler.cpp
Normal file
28
src/RESTAPI/RESTAPI_connectedDeviceHandler.cpp
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user