mirror of
https://github.com/Lukas0025/YAGS.git
synced 2025-04-24 15:51:37 +01:00
Added support dunction for get all api keys
This commit is contained in:
parent
fed902d45e
commit
2a4e21fde3
@ -3,9 +3,20 @@
|
|||||||
|
|
||||||
function APIinfo($params) {
|
function APIinfo($params) {
|
||||||
|
|
||||||
$station = new \DAL\station()
|
$station = new \DAL\station();
|
||||||
|
|
||||||
$station->find("apiKey", $params["key"])
|
$station->find("apiKey", $params["key"]);
|
||||||
|
|
||||||
return ["id" => $station->id->get(), "name" => $station->name->get(), "locator" => $station->locator->get()];
|
return ["id" => $station->id->get(), "name" => $station->name->get(), "locator" => $station->locator->get()];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function keys($params) {
|
||||||
|
$stations = new \wsos\database\core\table(\DAL\station::class);
|
||||||
|
|
||||||
|
$res = [];
|
||||||
|
foreach ($stations->getAll()->values as $station) {
|
||||||
|
$res[] = ["name" => $station->name->get(), "key" => $station->apiKey->get()];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $res;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user