mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-11-01 19:17:47 +00:00
Entity list call optimization.
This commit is contained in:
@@ -155,7 +155,7 @@ namespace OpenWifi {
|
||||
}
|
||||
|
||||
template <typename DB, typename Record> void ReturnRecordList(const char *ArrayName,DB & DBInstance, RESTAPIHandler & R) {
|
||||
auto UUIDs = Utils::Split(R.SelectedRecords());
|
||||
const auto UUIDs = Utils::Split(R.SelectedRecords());
|
||||
Poco::JSON::Array ObjArr;
|
||||
for(const auto &i:UUIDs) {
|
||||
Record E;
|
||||
|
||||
@@ -14,14 +14,13 @@
|
||||
namespace OpenWifi{
|
||||
|
||||
void RESTAPI_entity_list_handler::DoGet() {
|
||||
std::string Arg;
|
||||
if(!QB_.Select.empty()) {
|
||||
return ReturnRecordList<decltype(StorageService()->EntityDB()),
|
||||
ProvObjects::Entity>("entities",StorageService()->EntityDB(),*this );
|
||||
} else if(QB_.CountOnly) {
|
||||
auto C = StorageService()->EntityDB().Count();
|
||||
return ReturnCountOnly(C);
|
||||
} if (HasParameter("getTree",Arg) && Arg=="true") {
|
||||
} else if (GetBoolParameter("getTree",false)) {
|
||||
Poco::JSON::Object FullTree;
|
||||
StorageService()->EntityDB().BuildTree(FullTree);
|
||||
return ReturnObject(FullTree);
|
||||
@@ -33,8 +32,7 @@ namespace OpenWifi{
|
||||
}
|
||||
|
||||
void RESTAPI_entity_list_handler::DoPost() {
|
||||
std::string Arg;
|
||||
if (HasParameter("setTree",Arg) && Arg=="true") {
|
||||
if (GetBoolParameter("setTree",false)) {
|
||||
auto FullTree = ParseStream();
|
||||
StorageService()->EntityDB().ImportTree(FullTree);
|
||||
return OK();
|
||||
|
||||
Reference in New Issue
Block a user