refactoring, added rooms api

This commit is contained in:
xinatorus 2020-05-12 19:41:46 +02:00
parent 3981d9551d
commit c2203b452a
20 changed files with 18 additions and 2 deletions

View File

@ -14,8 +14,11 @@ $router->any('/automation', 'Automation');
$router->any('/setting', 'Setting');
$router->any('/ajax', 'Ajax');
$router->post('/api/devices', 'DevicesApi@getAllDevices');
$router->post('/api/login', 'AuthApi@login');
$router->post('/api/logout', 'AuthApi@logout');
$router->post('/api/devices', 'DevicesApi@default');
$router->post('/api/rooms', 'RoomsApi@default');
$router->get('/api/HA/auth', 'GoogleHomeApi@autorize');
$router->any('/api/HA', 'GoogleHomeApi@response');

View File

@ -2,7 +2,7 @@
class DevicesApi extends ApiController{
public function getAllDevices(){
public function default(){
$this->requireAuth();
$response = [];

13
app/api/RoomsApi.php Normal file
View File

@ -0,0 +1,13 @@
<?php
class RoomsApi extends ApiController{
public function default(){
$this->requireAuth();
$response = [];
// TODO: process the request
$this->response($response);
}
}