mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralgw.git
synced 2026-01-11 14:25:29 +00:00
28 lines
623 B
C++
28 lines
623 B
C++
//
|
|
// Created by stephane bourque on 2023-02-24.
|
|
//
|
|
|
|
#include "RESTAPI_regulatory.h"
|
|
#include "framework/ow_constants.h"
|
|
#include "RegulatoryInfo.h"
|
|
|
|
namespace OpenWifi {
|
|
void RESTAPI_regulatory::DoGet() {
|
|
|
|
if(GetBoolParameter("reload")) {
|
|
RegulatoryInfo()->Reload();
|
|
return OK();
|
|
}
|
|
|
|
auto CountryList = GetParameter("countries","");
|
|
if(CountryList.empty()) {
|
|
return BadRequest(RESTAPI::Errors::MissingOrInvalidParameters);
|
|
}
|
|
|
|
std::vector<GWObjects::RegulatoryCountryInfo> Answers;
|
|
RegulatoryInfo()->Get(CountryList, Answers);
|
|
return ReturnObject("countries", Answers);
|
|
|
|
}
|
|
|
|
} // namespace OpenWifi
|