|
|
|
|
1
|
<?php
|
1
|
<?php
|
2
|
|
2
|
|
3
|
-use App\Http\DBO\CamotionPermissions;
|
|
|
4
|
use Luticate\Auth\Business\LuticateBusiness;
|
3
|
use Luticate\Auth\Business\LuticateBusiness;
|
5
|
use Luticate\Doc\Business\LuDocBusiness;
|
4
|
use Luticate\Doc\Business\LuDocBusiness;
|
6
|
use Luticate\Utils\LuRoute;
|
5
|
use Luticate\Utils\LuRoute;
|
|
|
|
|
8
|
$route = LuRoute::getInstance();
|
7
|
$route = LuRoute::getInstance();
|
9
|
|
8
|
|
10
|
$int = LuRoute::REG_INT;
|
9
|
$int = LuRoute::REG_INT;
|
11
|
-$host_id = "{host_id:$int}";
|
|
|
12
|
-$camera_id = "{camera_id:$int}";
|
|
|
13
|
-$sensor_id = "{sensor_id:$int}";
|
|
|
14
|
-$command_id = "{command_id:$int}";
|
|
|
15
|
|
10
|
|
16
|
LuticateBusiness::setupAuth();
|
11
|
LuticateBusiness::setupAuth();
|
17
|
LuticateBusiness::setupRoutes();
|
12
|
LuticateBusiness::setupRoutes();
|
18
|
-LuDocBusiness::setupRoutes("/camotion");
|
|
|
|
|
13
|
+LuDocBusiness::setupRoutes("/project");
|
19
|
|
14
|
|
20
|
-$route->get("/hosts", "Hosts", "getAll", CamotionPermissions::HOST_GET);
|
|
|
21
|
-$route->get("/hosts/$host_id", "Hosts", "get", CamotionPermissions::HOST_GET);
|
|
|
22
|
-$route->post("/hosts/add", "Hosts", "add", array(CamotionPermissions::HOST_GET, CamotionPermissions::HOST_ADD));
|
|
|
23
|
-$route->post("/hosts/$host_id/edit", "Hosts", "edit", array(CamotionPermissions::HOST_GET, CamotionPermissions::HOST_EDIT));
|
|
|
24
|
-$route->post("/hosts/$host_id/del", "Hosts", "del", array(CamotionPermissions::HOST_GET, CamotionPermissions::HOST_DEL));
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-$route->get("/cameras/types", "Cameras", "getAllTypes", array(CamotionPermissions::CAMERA_GET, CamotionPermissions::CAMERA_ADD));
|
|
|
28
|
-$route->get("/cameras", "Cameras", "getAll", CamotionPermissions::CAMERA_GET);
|
|
|
29
|
-$route->get("/cameras/$camera_id", "Cameras", "get", CamotionPermissions::CAMERA_GET);
|
|
|
30
|
-$route->post("/cameras/add", "Cameras", "add", array(CamotionPermissions::CAMERA_GET, CamotionPermissions::CAMERA_ADD));
|
|
|
31
|
-$route->post("/cameras/$camera_id/edit", "Cameras", "edit", array(CamotionPermissions::CAMERA_GET, CamotionPermissions::CAMERA_EDIT));
|
|
|
32
|
-$route->post("/cameras/$camera_id/del", "Cameras", "del", array(CamotionPermissions::CAMERA_GET, CamotionPermissions::CAMERA_DEL));
|
|
|
33
|
-$route->post("/cameras/$camera_id/image", "Cameras", "getImage", array(CamotionPermissions::CAMERA_GET, CamotionPermissions::CAMERA_EXEC));
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-$route->get("/sensors/types", "Sensors", "getAllTypes", array(CamotionPermissions::SENSOR_GET, CamotionPermissions::SENSOR_ADD));
|
|
|
37
|
-$route->get("/sensors", "Sensors", "getAll", CamotionPermissions::SENSOR_GET);
|
|
|
38
|
-$route->get("/sensors/$sensor_id", "Sensors", "get", CamotionPermissions::SENSOR_GET);
|
|
|
39
|
-$route->post("/sensors/add", "Sensors", "add", array(CamotionPermissions::SENSOR_GET, CamotionPermissions::SENSOR_ADD));
|
|
|
40
|
-$route->post("/sensors/$sensor_id/edit", "Sensors", "edit", array(CamotionPermissions::SENSOR_GET, CamotionPermissions::SENSOR_EDIT));
|
|
|
41
|
-$route->post("/sensors/$sensor_id/del", "Sensors", "del", array(CamotionPermissions::SENSOR_GET, CamotionPermissions::SENSOR_DEL));
|
|
|
42
|
-$route->post("/sensors/$sensor_id/value", "Sensors", "getValue", array(CamotionPermissions::SENSOR_GET, CamotionPermissions::SENSOR_EXEC));
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-$route->get("/commands/types", "Commands", "getAllTypes", array(CamotionPermissions::COMMAND_GET, CamotionPermissions::COMMAND_ADD));
|
|
|
46
|
-$route->get("/commands", "Commands", "getAll", CamotionPermissions::COMMAND_GET);
|
|
|
47
|
-$route->get("/commands/$command_id", "Commands", "get", CamotionPermissions::COMMAND_GET);
|
|
|
48
|
-$route->post("/commands/add", "Commands", "add", array(CamotionPermissions::COMMAND_GET, CamotionPermissions::COMMAND_ADD));
|
|
|
49
|
-$route->post("/commands/$command_id/edit", "Commands", "edit", array(CamotionPermissions::COMMAND_GET, CamotionPermissions::COMMAND_EDIT));
|
|
|
50
|
-$route->post("/commands/$command_id/del", "Commands", "del", array(CamotionPermissions::COMMAND_GET, CamotionPermissions::COMMAND_DEL));
|
|
|
51
|
-$route->post("/commands/$command_id/exec", "Commands", "exec", array(CamotionPermissions::COMMAND_GET, CamotionPermissions::COMMAND_EXEC));
|
|
|
52
|
-
|
|
|
53
|
-$route->get("/other/config", "Other", "configApp");
|
|
|
54
|
-//sleep(1);
|
|
|
|
|
15
|
+$route->get("/data", "Data", "getAll", ProjectPermissions::HOST_GET);
|