mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-10-31 18:48:09 +00:00
Removing entity types.
This commit is contained in:
@@ -14,16 +14,11 @@
|
||||
namespace OpenWifi{
|
||||
|
||||
void RESTAPI_entity_list_handler::DoGet() {
|
||||
auto type = GetParameter("type","normal");
|
||||
if(!ValidEntityType(type)) {
|
||||
return BadRequest(RESTAPI::Errors::InvalidEntityType);
|
||||
}
|
||||
|
||||
if(!QB_.Select.empty()) {
|
||||
return ReturnRecordList<decltype(DB_),
|
||||
ProvObjects::Entity>("entities",DB_,*this );
|
||||
} else if(QB_.CountOnly) {
|
||||
auto C = DB_.Count(fmt::format(" where type='{}'", type));
|
||||
auto C = DB_.Count();
|
||||
return ReturnCountOnly(C);
|
||||
} else if (GetBoolParameter("getTree",false)) {
|
||||
Poco::JSON::Object FullTree;
|
||||
@@ -31,8 +26,7 @@ namespace OpenWifi{
|
||||
return ReturnObject(FullTree);
|
||||
} else {
|
||||
EntityDB::RecordVec Entities;
|
||||
|
||||
DB_.GetRecords(QB_.Offset, QB_.Limit,Entities,fmt::format(" where type='{}'", type));
|
||||
DB_.GetRecords(QB_.Offset, QB_.Limit,Entities);
|
||||
return MakeJSONObjectArray("entities", Entities, *this);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user