mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralfms.git
synced 2025-11-22 04:55:09 +00:00
Refactoring project layout.
This commit is contained in:
29
src/RESTAPI/RESTAPI_connectedDevicesHandler.cpp
Normal file
29
src/RESTAPI/RESTAPI_connectedDevicesHandler.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// Created by stephane bourque on 2021-07-18.
|
||||
//
|
||||
|
||||
#include "RESTAPI_connectedDevicesHandler.h"
|
||||
#include "RESTAPI_FMSObjects.h"
|
||||
#include "Poco/JSON/Object.h"
|
||||
#include "Poco/JSON/Array.h"
|
||||
#include "StorageService.h"
|
||||
#include "framework/RESTAPI_protocol.h"
|
||||
|
||||
namespace OpenWifi {
|
||||
void RESTAPI_connectedDevicesHandler::DoGet() {
|
||||
std::vector<FMSObjects::DeviceConnectionInformation> Devices;
|
||||
Poco::JSON::Object AnswerObj;
|
||||
Poco::JSON::Array AnswerArr;
|
||||
if (Storage()->GetDevices(QB_.Offset, QB_.Limit, Devices)) {
|
||||
for (const auto &i:Devices) {
|
||||
Poco::JSON::Object Obj;
|
||||
i.to_json(Obj);
|
||||
AnswerArr.add(Obj);
|
||||
}
|
||||
AnswerObj.set(RESTAPI::Protocol::DEVICES, AnswerArr);
|
||||
return ReturnObject(AnswerObj);
|
||||
}
|
||||
AnswerObj.set(RESTAPI::Protocol::DEVICES, AnswerArr);
|
||||
ReturnObject(AnswerObj);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user