mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-11-03 03:57:55 +00:00
Adding MAP API.
This commit is contained in:
25
src/RESTAPI/RESTAPI_map_list_handler.cpp
Normal file
25
src/RESTAPI/RESTAPI_map_list_handler.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// Created by stephane bourque on 2021-11-09.
|
||||
//
|
||||
|
||||
#include "RESTAPI_map_list_handler.h"
|
||||
#include "RESTObjects/RESTAPI_ProvObjects.h"
|
||||
#include "StorageService.h"
|
||||
#include "RESTAPI/RESTAPI_db_helpers.h"
|
||||
|
||||
namespace OpenWifi{
|
||||
void RESTAPI_map_list_handler::DoGet() {
|
||||
if(!QB_.Select.empty()) {
|
||||
return ReturnRecordList<decltype(StorageService()->MapDB()),
|
||||
ProvObjects::Map>("list",StorageService()->MapDB(),*this );
|
||||
} else if(QB_.CountOnly) {
|
||||
Poco::JSON::Object Answer;
|
||||
auto C = StorageService()->MapDB().Count();
|
||||
return ReturnCountOnly(C);
|
||||
} else {
|
||||
std::vector<ProvObjects::Map> Maps;
|
||||
StorageService()->MapDB().GetRecords(QB_.Offset,QB_.Limit,Maps);
|
||||
return MakeJSONObjectArray("list", Maps, *this);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user