Commit 2f394319 authored by Andreas Heimann's avatar Andreas Heimann

added current version api call

parent a4ce8eca
...@@ -16,6 +16,7 @@ use App\Entity\Ad; ...@@ -16,6 +16,7 @@ use App\Entity\Ad;
class APIController extends AbstractController class APIController extends AbstractController
{ {
public $currentVersion = 1; public $currentVersion = 1;
public $clientVersion = [1, 0, 0];
/** /**
* @Route("/api/ping", name="api.ping") * @Route("/api/ping", name="api.ping")
...@@ -25,6 +26,14 @@ class APIController extends AbstractController ...@@ -25,6 +26,14 @@ class APIController extends AbstractController
return new JsonResponse(['version' => $this->currentVersion, 'status' => 200, 'pong' => true]); return new JsonResponse(['version' => $this->currentVersion, 'status' => 200, 'pong' => true]);
} }
/**
* @Route("/api/currentVersion", name="api.currentVersion")
*/
public function currentVersion()
{
return new JsonResponse(['version' => $this->currentVersion, 'status' => 200, 'data' => $this->clientVersion]);
}
/** /**
* @Route("/api/songs/new/{offset}", name="api.songs.new") * @Route("/api/songs/new/{offset}", name="api.songs.new")
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment