Refactoring and adding VariableBlocks.

This commit is contained in:
stephb9959
2022-02-23 22:27:59 -08:00
parent df70ec8f40
commit 73a096b0ad
35 changed files with 518 additions and 90 deletions

View File

@@ -11,15 +11,15 @@
namespace OpenWifi{
void RESTAPI_contact_list_handler::DoGet() {
if(!QB_.Select.empty()) {
return ReturnRecordList<decltype(StorageService()->ContactDB()),
ProvObjects::Contact>("contacts",StorageService()->ContactDB(),*this );
return ReturnRecordList<decltype(DB_),
ProvObjects::Contact>("contacts",DB_,*this );
} else if(QB_.CountOnly) {
Poco::JSON::Object Answer;
auto C = StorageService()->ContactDB().Count();
auto C = DB_.Count();
return ReturnCountOnly(C);
} else {
ProvObjects::ContactVec Contacts;
StorageService()->ContactDB().GetRecords(QB_.Offset,QB_.Limit,Contacts);
ContactDB::RecordVec Contacts;
DB_.GetRecords(QB_.Offset,QB_.Limit,Contacts);
return MakeJSONObjectArray("contacts", Contacts, *this);
}
}