mirror of
https://github.com/Telecominfraproject/wlan-cloud-analytics.git
synced 2026-03-20 03:39:59 +00:00
Signed-off-by: stephb9959 <stephane.bourque@gmail.com>
This commit is contained in:
@@ -3,31 +3,31 @@
|
||||
//
|
||||
|
||||
#include "RESTAPI_board_list_handler.h"
|
||||
#include "StorageService.h"
|
||||
#include "RESTAPI/RESTAPI_analytics_db_helpers.h"
|
||||
#include "StorageService.h"
|
||||
|
||||
namespace OpenWifi {
|
||||
void RESTAPI_board_list_handler::DoGet() {
|
||||
auto forVenue = GetParameter("forVenue","");
|
||||
void RESTAPI_board_list_handler::DoGet() {
|
||||
auto forVenue = GetParameter("forVenue", "");
|
||||
|
||||
if(!forVenue.empty()) {
|
||||
std::vector<AnalyticsObjects::BoardInfo> Boards;
|
||||
auto F = [&](const AnalyticsObjects::BoardInfo &B) -> bool {
|
||||
if(!B.venueList.empty()) {
|
||||
for(const auto &venue:B.venueList) {
|
||||
if(venue.id == forVenue) {
|
||||
Boards.emplace_back(B);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
DB_.Iterate(F);
|
||||
return ReturnObject("boards",Boards);
|
||||
}
|
||||
if (!forVenue.empty()) {
|
||||
std::vector<AnalyticsObjects::BoardInfo> Boards;
|
||||
auto F = [&](const AnalyticsObjects::BoardInfo &B) -> bool {
|
||||
if (!B.venueList.empty()) {
|
||||
for (const auto &venue : B.venueList) {
|
||||
if (venue.id == forVenue) {
|
||||
Boards.emplace_back(B);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
DB_.Iterate(F);
|
||||
return ReturnObject("boards", Boards);
|
||||
}
|
||||
|
||||
return ListHandler<BoardsDB>("boards", DB_, *this);
|
||||
}
|
||||
return ListHandler<BoardsDB>("boards", DB_, *this);
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace OpenWifi
|
||||
Reference in New Issue
Block a user