|
@@ -2,9 +2,12 @@
|
2
|
2
|
|
3
|
3
|
namespace App\Http\Business;
|
4
|
4
|
|
|
5
|
+use App\Http\DBO\CameraTypesDbo;
|
|
6
|
+use App\Http\DBO\HostsDbo;
|
5
|
7
|
use Luticate\Utils\LuBusiness;
|
6
|
8
|
use App\Http\DataAccess\CamerasDataAccess;
|
7
|
9
|
use App\Http\DBO\CamerasDbo;
|
|
10
|
+use Luticate\Utils\LuRequest;
|
8
|
11
|
|
9
|
12
|
class CamerasBusiness extends LuBusiness {
|
10
|
13
|
protected static function getDataAccess()
|
|
@@ -48,4 +51,18 @@ class CamerasBusiness extends LuBusiness {
|
48
|
51
|
$camera->setId($camera_id);
|
49
|
52
|
return CamerasDataAccess::editById($camera_id, $camera);
|
50
|
53
|
}
|
|
54
|
+
|
|
55
|
+ public static function getImage($camera_id)
|
|
56
|
+ {
|
|
57
|
+ /**
|
|
58
|
+ * @var $camera CamerasDbo
|
|
59
|
+ * @var $host HostsDbo
|
|
60
|
+ * @var $type CameraTypesDbo
|
|
61
|
+ */
|
|
62
|
+ $camera = self::getById($camera_id);
|
|
63
|
+ $host = HostsBusiness::getById($camera->getHostId());
|
|
64
|
+ $type = CameraTypesBusiness::getById($camera->getCameraTypeId());
|
|
65
|
+ return LuRequest::proxy('POST', $host->getUrl() . "/cameras/image", [],
|
|
66
|
+ ["camera" => $camera->__toString(), "type" => $type->__toString()], ["X-Token" => $host->getToken()]);
|
|
67
|
+ }
|
51
|
68
|
}
|