Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

cameras.js 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. * Created by robin on 11/21/15.
  3. */
  4. (function () {
  5. 'use strict';
  6. angular.module('camotionSdk')
  7. .factory('CamerasService', ['luticateRequest', function (luticateRequest) {
  8. var CamerasService = {};
  9. CamerasService.add = function(data, promise)
  10. {
  11. return luticateRequest.post("/api/cameras/add", {camera: JSON.stringify(data)}, null, promise);
  12. };
  13. CamerasService.getAll = function(data, promise)
  14. {
  15. return luticateRequest.get("/api/cameras", data, promise);
  16. };
  17. CamerasService.getAllTypes = function(promise)
  18. {
  19. return luticateRequest.get("/api/cameras/types", null, promise);
  20. };
  21. CamerasService.get = function(data, promise)
  22. {
  23. return luticateRequest.get("/api/cameras/" + data.camera_id , null, promise);
  24. };
  25. CamerasService.edit = function(data, promise)
  26. {
  27. return luticateRequest.post("/api/cameras/" + data.camera_id + "/edit", {camera: JSON.stringify(data)}, null, promise);
  28. };
  29. CamerasService.del = function(data, promise)
  30. {
  31. return luticateRequest.post("/api/cameras/" + data.camera_id + "/del", null, null, promise);
  32. };
  33. CamerasService.getImage = function(data, promise)
  34. {
  35. return luticateRequest.post("/api/cameras/" + data.camera_id + "/image", null, null, promise);
  36. };
  37. return CamerasService;
  38. }]);
  39. })();