mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-11-01 19:17:47 +00:00
Add /subdevice serial number lookup.
This commit is contained in:
@@ -15,9 +15,17 @@ namespace OpenWifi {
|
||||
}
|
||||
|
||||
ProvObjects::SubscriberDevice SD;
|
||||
if(Utils::ValidUUID(uuid)) {
|
||||
if (!DB_.GetRecord("id", uuid, SD)) {
|
||||
return NotFound();
|
||||
}
|
||||
} else if(Utils::ValidSerialNumber(uuid)) {
|
||||
if (!DB_.GetRecord("serialNumber", uuid, SD)) {
|
||||
return NotFound();
|
||||
}
|
||||
} else {
|
||||
return BadRequest(RESTAPI::Errors::MissingOrInvalidParameters);
|
||||
}
|
||||
|
||||
Poco::JSON::Object Answer;
|
||||
SD.to_json(Answer);
|
||||
|
||||
Reference in New Issue
Block a user