1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- /**
- * Created by robin on 11/21/15.
- */
- (function () {
- 'use strict';
-
- angular.module('camotionAdmin')
- .factory('SensorsService', ['luticateRequest', function (luticateRequest) {
-
- var SensorsService = {};
-
- SensorsService.add = function(data, promise)
- {
- return luticateRequest.post("/api/sensors/add", {sensor: JSON.stringify(data)}, null, promise);
- };
-
- SensorsService.getAll = function(data, promise)
- {
- return luticateRequest.get("/api/sensors", data, promise);
- };
-
- SensorsService.getAllTypes = function(promise)
- {
- return luticateRequest.get("/api/sensors/types", null, promise);
- };
-
- SensorsService.get = function(data, promise)
- {
- return luticateRequest.get("/api/sensors/" + data.sensor_id , null, promise);
- };
-
- SensorsService.edit = function(data, promise)
- {
- return luticateRequest.post("/api/sensors/" + data.sensor_id + "/edit", {sensor: JSON.stringify(data)}, null, promise);
- };
-
- SensorsService.del = function(data, promise)
- {
- return luticateRequest.post("/api/sensors/" + data.sensor_id + "/del", null, null, promise);
- };
-
- return SensorsService;
- }]);
- })();
|