12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- /**
- * Created by robin on 11/21/15.
- */
- (function () {
- 'use strict';
-
- angular.module('camotionSdk')
- .factory('CamerasService', ['luticateRequest', function (luticateRequest) {
-
- var CamerasService = {};
-
- CamerasService.add = function(data, promise)
- {
- return luticateRequest.post("/api/cameras/add", {camera: JSON.stringify(data)}, null, promise);
- };
-
- CamerasService.getAll = function(data, promise)
- {
- return luticateRequest.get("/api/cameras", data, promise);
- };
-
- CamerasService.getAllTypes = function(promise)
- {
- return luticateRequest.get("/api/cameras/types", null, promise);
- };
-
- CamerasService.get = function(data, promise)
- {
- return luticateRequest.get("/api/cameras/" + data.camera_id , null, promise);
- };
-
- CamerasService.edit = function(data, promise)
- {
- return luticateRequest.post("/api/cameras/" + data.camera_id + "/edit", {camera: JSON.stringify(data)}, null, promise);
- };
-
- CamerasService.del = function(data, promise)
- {
- return luticateRequest.post("/api/cameras/" + data.camera_id + "/del", null, null, promise);
- };
-
- CamerasService.getImage = function(data, promise)
- {
- return luticateRequest.post("/api/cameras/" + data.camera_id + "/image", null, null, promise);
- };
-
- return CamerasService;
- }]);
- })();
|