2016-12-01 11:40:28 +02:00
|
|
|
/*
|
2020-01-06 16:52:41 +02:00
|
|
|
* Copyright © 2016-2020 The Thingsboard Authors
|
2016-12-01 11:40:28 +02:00
|
|
|
*
|
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
|
*
|
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
*
|
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
|
* limitations under the License.
|
|
|
|
|
*/
|
|
|
|
|
import thingsboardTypes from '../common/types.constant';
|
|
|
|
|
|
|
|
|
|
export default angular.module('thingsboard.api.device', [thingsboardTypes])
|
|
|
|
|
.factory('deviceService', DeviceService)
|
|
|
|
|
.name;
|
|
|
|
|
|
|
|
|
|
/*@ngInject*/
|
2020-06-02 12:46:57 +03:00
|
|
|
function DeviceService($http, $q, $window, $filter, userService, attributeService, customerService, types) {
|
2016-12-01 11:40:28 +02:00
|
|
|
|
|
|
|
|
var service = {
|
|
|
|
|
assignDeviceToCustomer: assignDeviceToCustomer,
|
|
|
|
|
deleteDevice: deleteDevice,
|
|
|
|
|
getCustomerDevices: getCustomerDevices,
|
|
|
|
|
getDevice: getDevice,
|
2017-03-07 12:26:42 +02:00
|
|
|
getDevices: getDevices,
|
2016-12-01 11:40:28 +02:00
|
|
|
getDeviceCredentials: getDeviceCredentials,
|
|
|
|
|
getTenantDevices: getTenantDevices,
|
|
|
|
|
saveDevice: saveDevice,
|
|
|
|
|
saveDeviceCredentials: saveDeviceCredentials,
|
|
|
|
|
unassignDeviceFromCustomer: unassignDeviceFromCustomer,
|
2017-04-23 18:04:55 +03:00
|
|
|
makeDevicePublic: makeDevicePublic,
|
2016-12-01 11:40:28 +02:00
|
|
|
getDeviceAttributes: getDeviceAttributes,
|
|
|
|
|
subscribeForDeviceAttributes: subscribeForDeviceAttributes,
|
|
|
|
|
unsubscribeForDeviceAttributes: unsubscribeForDeviceAttributes,
|
|
|
|
|
saveDeviceAttributes: saveDeviceAttributes,
|
|
|
|
|
deleteDeviceAttributes: deleteDeviceAttributes,
|
|
|
|
|
sendOneWayRpcCommand: sendOneWayRpcCommand,
|
2017-05-24 10:39:33 +03:00
|
|
|
sendTwoWayRpcCommand: sendTwoWayRpcCommand,
|
2017-05-28 18:23:05 +03:00
|
|
|
findByQuery: findByQuery,
|
2019-06-06 19:43:07 +03:00
|
|
|
getDeviceTypes: getDeviceTypes,
|
2019-11-08 11:49:43 +02:00
|
|
|
findByName: findByName,
|
2020-02-19 15:50:19 +02:00
|
|
|
claimDevice: claimDevice,
|
2020-03-17 18:43:22 +02:00
|
|
|
unclaimDevice: unclaimDevice,
|
2019-11-08 11:49:43 +02:00
|
|
|
assignDeviceToEdge: assignDeviceToEdge,
|
|
|
|
|
unassignDeviceFromEdge: unassignDeviceFromEdge,
|
|
|
|
|
getEdgeDevices: getEdgeDevices
|
2019-06-06 19:43:07 +03:00
|
|
|
};
|
2016-12-01 11:40:28 +02:00
|
|
|
|
|
|
|
|
return service;
|
|
|
|
|
|
2017-05-28 18:23:05 +03:00
|
|
|
function getTenantDevices(pageLink, applyCustomersInfo, config, type) {
|
2016-12-01 11:40:28 +02:00
|
|
|
var deferred = $q.defer();
|
|
|
|
|
var url = '/api/tenant/devices?limit=' + pageLink.limit;
|
|
|
|
|
if (angular.isDefined(pageLink.textSearch)) {
|
|
|
|
|
url += '&textSearch=' + pageLink.textSearch;
|
|
|
|
|
}
|
|
|
|
|
if (angular.isDefined(pageLink.idOffset)) {
|
|
|
|
|
url += '&idOffset=' + pageLink.idOffset;
|
|
|
|
|
}
|
|
|
|
|
if (angular.isDefined(pageLink.textOffset)) {
|
|
|
|
|
url += '&textOffset=' + pageLink.textOffset;
|
|
|
|
|
}
|
2017-05-28 18:23:05 +03:00
|
|
|
if (angular.isDefined(type) && type.length) {
|
|
|
|
|
url += '&type=' + type;
|
|
|
|
|
}
|
2017-04-17 12:21:12 +03:00
|
|
|
$http.get(url, config).then(function success(response) {
|
2017-04-23 18:04:55 +03:00
|
|
|
if (applyCustomersInfo) {
|
|
|
|
|
customerService.applyAssignedCustomersInfo(response.data.data).then(
|
|
|
|
|
function success(data) {
|
|
|
|
|
response.data.data = data;
|
|
|
|
|
deferred.resolve(response.data);
|
|
|
|
|
},
|
|
|
|
|
function fail() {
|
|
|
|
|
deferred.reject();
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
deferred.resolve(response.data);
|
|
|
|
|
}
|
2016-12-01 11:40:28 +02:00
|
|
|
}, function fail() {
|
|
|
|
|
deferred.reject();
|
|
|
|
|
});
|
|
|
|
|
return deferred.promise;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-28 18:23:05 +03:00
|
|
|
function getCustomerDevices(customerId, pageLink, applyCustomersInfo, config, type) {
|
2016-12-01 11:40:28 +02:00
|
|
|
var deferred = $q.defer();
|
|
|
|
|
var url = '/api/customer/' + customerId + '/devices?limit=' + pageLink.limit;
|
|
|
|
|
if (angular.isDefined(pageLink.textSearch)) {
|
|
|
|
|
url += '&textSearch=' + pageLink.textSearch;
|
|
|
|
|
}
|
|
|
|
|
if (angular.isDefined(pageLink.idOffset)) {
|
|
|
|
|
url += '&idOffset=' + pageLink.idOffset;
|
|
|
|
|
}
|
|
|
|
|
if (angular.isDefined(pageLink.textOffset)) {
|
|
|
|
|
url += '&textOffset=' + pageLink.textOffset;
|
|
|
|
|
}
|
2017-05-28 18:23:05 +03:00
|
|
|
if (angular.isDefined(type) && type.length) {
|
|
|
|
|
url += '&type=' + type;
|
|
|
|
|
}
|
2017-04-23 18:04:55 +03:00
|
|
|
$http.get(url, config).then(function success(response) {
|
|
|
|
|
if (applyCustomersInfo) {
|
|
|
|
|
customerService.applyAssignedCustomerInfo(response.data.data, customerId).then(
|
|
|
|
|
function success(data) {
|
|
|
|
|
response.data.data = data;
|
|
|
|
|
deferred.resolve(response.data);
|
|
|
|
|
},
|
|
|
|
|
function fail() {
|
|
|
|
|
deferred.reject();
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
deferred.resolve(response.data);
|
|
|
|
|
}
|
2016-12-01 11:40:28 +02:00
|
|
|
}, function fail() {
|
|
|
|
|
deferred.reject();
|
|
|
|
|
});
|
2017-04-23 18:04:55 +03:00
|
|
|
|
2016-12-01 11:40:28 +02:00
|
|
|
return deferred.promise;
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-23 18:04:55 +03:00
|
|
|
function getDevice(deviceId, ignoreErrors, config) {
|
2016-12-01 11:40:28 +02:00
|
|
|
var deferred = $q.defer();
|
|
|
|
|
var url = '/api/device/' + deviceId;
|
2017-04-23 18:04:55 +03:00
|
|
|
if (!config) {
|
|
|
|
|
config = {};
|
|
|
|
|
}
|
2019-05-20 11:57:43 +03:00
|
|
|
config = Object.assign(config, {ignoreErrors: ignoreErrors});
|
2017-04-23 18:04:55 +03:00
|
|
|
$http.get(url, config).then(function success(response) {
|
2016-12-01 11:40:28 +02:00
|
|
|
deferred.resolve(response.data);
|
|
|
|
|
}, function fail(response) {
|
|
|
|
|
deferred.reject(response.data);
|
|
|
|
|
});
|
|
|
|
|
return deferred.promise;
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-23 18:04:55 +03:00
|
|
|
function getDevices(deviceIds, config) {
|
2017-03-07 12:26:42 +02:00
|
|
|
var deferred = $q.defer();
|
|
|
|
|
var ids = '';
|
2019-05-20 11:57:43 +03:00
|
|
|
for (var i = 0; i < deviceIds.length; i++) {
|
|
|
|
|
if (i > 0) {
|
2017-03-07 12:26:42 +02:00
|
|
|
ids += ',';
|
|
|
|
|
}
|
|
|
|
|
ids += deviceIds[i];
|
|
|
|
|
}
|
|
|
|
|
var url = '/api/devices?deviceIds=' + ids;
|
2017-04-23 18:04:55 +03:00
|
|
|
$http.get(url, config).then(function success(response) {
|
2017-03-07 12:26:42 +02:00
|
|
|
var devices = response.data;
|
|
|
|
|
devices.sort(function (device1, device2) {
|
2019-05-20 11:57:43 +03:00
|
|
|
var id1 = device1.id.id;
|
|
|
|
|
var id2 = device2.id.id;
|
|
|
|
|
var index1 = deviceIds.indexOf(id1);
|
|
|
|
|
var index2 = deviceIds.indexOf(id2);
|
|
|
|
|
return index1 - index2;
|
2017-03-07 12:26:42 +02:00
|
|
|
});
|
|
|
|
|
deferred.resolve(devices);
|
|
|
|
|
}, function fail(response) {
|
|
|
|
|
deferred.reject(response.data);
|
|
|
|
|
});
|
|
|
|
|
return deferred.promise;
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-20 11:57:43 +03:00
|
|
|
function saveDevice(device, config) {
|
|
|
|
|
config = config || {};
|
2016-12-01 11:40:28 +02:00
|
|
|
var deferred = $q.defer();
|
|
|
|
|
var url = '/api/device';
|
2019-05-20 11:57:43 +03:00
|
|
|
$http.post(url, device, config).then(function success(response) {
|
2016-12-01 11:40:28 +02:00
|
|
|
deferred.resolve(response.data);
|
2019-05-23 17:56:22 +03:00
|
|
|
}, function fail() {
|
|
|
|
|
deferred.reject();
|
2019-05-21 19:00:52 +03:00
|
|
|
});
|
|
|
|
|
return deferred.promise;
|
|
|
|
|
}
|
|
|
|
|
|
2016-12-01 11:40:28 +02:00
|
|
|
function deleteDevice(deviceId) {
|
|
|
|
|
var deferred = $q.defer();
|
|
|
|
|
var url = '/api/device/' + deviceId;
|
|
|
|
|
$http.delete(url).then(function success() {
|
|
|
|
|
deferred.resolve();
|
2017-04-23 18:04:55 +03:00
|
|
|
}, function fail() {
|
|
|
|
|
deferred.reject();
|
2016-12-01 11:40:28 +02:00
|
|
|
});
|
|
|
|
|
return deferred.promise;
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-31 20:40:00 +03:00
|
|
|
function getDeviceCredentials(deviceId, sync, config) {
|
|
|
|
|
config = config || {};
|
2016-12-01 11:40:28 +02:00
|
|
|
var deferred = $q.defer();
|
|
|
|
|
var url = '/api/device/' + deviceId + '/credentials';
|
2018-02-21 20:05:03 +02:00
|
|
|
if (sync) {
|
|
|
|
|
var request = new $window.XMLHttpRequest();
|
|
|
|
|
request.open('GET', url, false);
|
|
|
|
|
request.setRequestHeader("Accept", "application/json, text/plain, */*");
|
|
|
|
|
userService.setAuthorizationRequestHeader(request);
|
|
|
|
|
request.send(null);
|
|
|
|
|
if (request.status === 200) {
|
|
|
|
|
deferred.resolve(angular.fromJson(request.responseText));
|
|
|
|
|
} else {
|
|
|
|
|
deferred.reject();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2019-05-31 20:40:00 +03:00
|
|
|
$http.get(url, config).then(function success(response) {
|
2018-02-21 20:05:03 +02:00
|
|
|
deferred.resolve(response.data);
|
|
|
|
|
}, function fail() {
|
|
|
|
|
deferred.reject();
|
|
|
|
|
});
|
|
|
|
|
}
|
2016-12-01 11:40:28 +02:00
|
|
|
return deferred.promise;
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-31 20:40:00 +03:00
|
|
|
function saveDeviceCredentials(deviceCredentials, config) {
|
|
|
|
|
config = config || {};
|
2016-12-01 11:40:28 +02:00
|
|
|
var deferred = $q.defer();
|
|
|
|
|
var url = '/api/device/credentials';
|
2019-05-31 20:40:00 +03:00
|
|
|
$http.post(url, deviceCredentials, config).then(function success(response) {
|
2016-12-01 11:40:28 +02:00
|
|
|
deferred.resolve(response.data);
|
2017-04-23 18:04:55 +03:00
|
|
|
}, function fail() {
|
|
|
|
|
deferred.reject();
|
2016-12-01 11:40:28 +02:00
|
|
|
});
|
|
|
|
|
return deferred.promise;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function assignDeviceToCustomer(customerId, deviceId) {
|
|
|
|
|
var deferred = $q.defer();
|
|
|
|
|
var url = '/api/customer/' + customerId + '/device/' + deviceId;
|
2017-04-23 18:04:55 +03:00
|
|
|
$http.post(url, null).then(function success(response) {
|
|
|
|
|
deferred.resolve(response.data);
|
|
|
|
|
}, function fail() {
|
|
|
|
|
deferred.reject();
|
2016-12-01 11:40:28 +02:00
|
|
|
});
|
|
|
|
|
return deferred.promise;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function unassignDeviceFromCustomer(deviceId) {
|
|
|
|
|
var deferred = $q.defer();
|
|
|
|
|
var url = '/api/customer/device/' + deviceId;
|
2017-04-23 18:04:55 +03:00
|
|
|
$http.delete(url).then(function success(response) {
|
|
|
|
|
deferred.resolve(response.data);
|
|
|
|
|
}, function fail() {
|
|
|
|
|
deferred.reject();
|
|
|
|
|
});
|
|
|
|
|
return deferred.promise;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function makeDevicePublic(deviceId) {
|
|
|
|
|
var deferred = $q.defer();
|
|
|
|
|
var url = '/api/customer/public/device/' + deviceId;
|
|
|
|
|
$http.post(url, null).then(function success(response) {
|
|
|
|
|
deferred.resolve(response.data);
|
|
|
|
|
}, function fail() {
|
|
|
|
|
deferred.reject();
|
2016-12-01 11:40:28 +02:00
|
|
|
});
|
|
|
|
|
return deferred.promise;
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-17 12:21:12 +03:00
|
|
|
function getDeviceAttributes(deviceId, attributeScope, query, successCallback, config) {
|
2017-05-24 10:39:33 +03:00
|
|
|
return attributeService.getEntityAttributes(types.entityType.device, deviceId, attributeScope, query, successCallback, config);
|
2016-12-01 11:40:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function subscribeForDeviceAttributes(deviceId, attributeScope) {
|
2017-05-24 10:39:33 +03:00
|
|
|
return attributeService.subscribeForEntityAttributes(types.entityType.device, deviceId, attributeScope);
|
2016-12-01 11:40:28 +02:00
|
|
|
}
|
2017-05-24 10:39:33 +03:00
|
|
|
|
2016-12-01 11:40:28 +02:00
|
|
|
function unsubscribeForDeviceAttributes(subscriptionId) {
|
2017-05-24 10:39:33 +03:00
|
|
|
attributeService.unsubscribeForEntityAttributes(subscriptionId);
|
2016-12-01 11:40:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function saveDeviceAttributes(deviceId, attributeScope, attributes) {
|
2017-05-24 10:39:33 +03:00
|
|
|
return attributeService.saveEntityAttributes(types.entityType.device, deviceId, attributeScope, attributes);
|
2016-12-01 11:40:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function deleteDeviceAttributes(deviceId, attributeScope, attributes) {
|
2017-05-24 10:39:33 +03:00
|
|
|
return attributeService.deleteEntityAttributes(types.entityType.device, deviceId, attributeScope, attributes);
|
2016-12-01 11:40:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function sendOneWayRpcCommand(deviceId, requestBody) {
|
|
|
|
|
var deferred = $q.defer();
|
|
|
|
|
var url = '/api/plugins/rpc/oneway/' + deviceId;
|
|
|
|
|
$http.post(url, requestBody).then(function success(response) {
|
|
|
|
|
deferred.resolve(response.data);
|
|
|
|
|
}, function fail(rejection) {
|
|
|
|
|
deferred.reject(rejection);
|
|
|
|
|
});
|
|
|
|
|
return deferred.promise;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function sendTwoWayRpcCommand(deviceId, requestBody) {
|
|
|
|
|
var deferred = $q.defer();
|
|
|
|
|
var url = '/api/plugins/rpc/twoway/' + deviceId;
|
|
|
|
|
$http.post(url, requestBody).then(function success(response) {
|
|
|
|
|
deferred.resolve(response.data);
|
|
|
|
|
}, function fail(rejection) {
|
|
|
|
|
deferred.reject(rejection);
|
|
|
|
|
});
|
|
|
|
|
return deferred.promise;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-24 10:39:33 +03:00
|
|
|
function findByQuery(query, ignoreErrors, config) {
|
|
|
|
|
var deferred = $q.defer();
|
|
|
|
|
var url = '/api/devices';
|
|
|
|
|
if (!config) {
|
|
|
|
|
config = {};
|
|
|
|
|
}
|
2019-05-20 11:57:43 +03:00
|
|
|
config = Object.assign(config, {ignoreErrors: ignoreErrors});
|
2017-05-24 10:39:33 +03:00
|
|
|
$http.post(url, query, config).then(function success(response) {
|
|
|
|
|
deferred.resolve(response.data);
|
|
|
|
|
}, function fail() {
|
|
|
|
|
deferred.reject();
|
|
|
|
|
});
|
|
|
|
|
return deferred.promise;
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-29 19:09:34 +02:00
|
|
|
function getDeviceTypes(config) {
|
2017-05-28 18:23:05 +03:00
|
|
|
var deferred = $q.defer();
|
|
|
|
|
var url = '/api/device/types';
|
2017-12-29 19:09:34 +02:00
|
|
|
$http.get(url, config).then(function success(response) {
|
2017-05-28 18:23:05 +03:00
|
|
|
deferred.resolve(response.data);
|
|
|
|
|
}, function fail() {
|
|
|
|
|
deferred.reject();
|
|
|
|
|
});
|
|
|
|
|
return deferred.promise;
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-20 11:57:43 +03:00
|
|
|
function findByName(deviceName, config) {
|
|
|
|
|
config = config || {};
|
|
|
|
|
var deferred = $q.defer();
|
|
|
|
|
var url = '/api/tenant/devices?deviceName=' + deviceName;
|
|
|
|
|
$http.get(url, config).then(function success(response) {
|
|
|
|
|
deferred.resolve(response.data);
|
2019-05-23 17:56:22 +03:00
|
|
|
}, function fail() {
|
|
|
|
|
deferred.reject();
|
2019-05-20 11:57:43 +03:00
|
|
|
});
|
|
|
|
|
return deferred.promise;
|
|
|
|
|
}
|
2019-11-08 11:49:43 +02:00
|
|
|
|
2020-02-19 15:50:19 +02:00
|
|
|
function claimDevice(deviceName, deviceSecret, config) {
|
|
|
|
|
deviceSecret = deviceSecret || {};
|
|
|
|
|
config = config || {};
|
|
|
|
|
const deferred = $q.defer();
|
|
|
|
|
const url = '/api/customer/device/' + deviceName + '/claim';
|
|
|
|
|
$http.post(url, deviceSecret, config).then(function success(response) {
|
|
|
|
|
deferred.resolve(response.data);
|
|
|
|
|
}, function fail(rejection) {
|
|
|
|
|
deferred.reject(rejection);
|
|
|
|
|
});
|
|
|
|
|
return deferred.promise;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function unclaimDevice(deviceName) {
|
|
|
|
|
const deferred = $q.defer();
|
|
|
|
|
const url = '/api/customer/device/' + deviceName + '/claim';
|
|
|
|
|
$http.delete(url).then(function success(response) {
|
|
|
|
|
deferred.resolve(response.data);
|
|
|
|
|
}, function fail(rejection) {
|
|
|
|
|
deferred.reject(rejection);
|
|
|
|
|
});
|
|
|
|
|
return deferred.promise;
|
|
|
|
|
}
|
2020-03-17 18:43:22 +02:00
|
|
|
|
2019-11-08 11:49:43 +02:00
|
|
|
function assignDeviceToEdge(edgeId, deviceId) {
|
|
|
|
|
var deferred = $q.defer();
|
|
|
|
|
var url = '/api/edge/' + edgeId + '/device/' + deviceId;
|
|
|
|
|
$http.post(url, null).then(function success(response) {
|
|
|
|
|
deferred.resolve(response.data);
|
|
|
|
|
}, function fail() {
|
|
|
|
|
deferred.reject();
|
|
|
|
|
});
|
|
|
|
|
return deferred.promise;
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-02 12:46:57 +03:00
|
|
|
function unassignDeviceFromEdge(edgeId, deviceId) {
|
2019-11-08 11:49:43 +02:00
|
|
|
var deferred = $q.defer();
|
2020-06-02 12:46:57 +03:00
|
|
|
var url = '/api/edge/' + edgeId + '/device/' + deviceId;
|
2019-11-08 11:49:43 +02:00
|
|
|
$http.delete(url).then(function success(response) {
|
|
|
|
|
deferred.resolve(response.data);
|
|
|
|
|
}, function fail() {
|
|
|
|
|
deferred.reject();
|
|
|
|
|
});
|
|
|
|
|
return deferred.promise;
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-15 13:22:24 +02:00
|
|
|
function getEdgeDevices(edgeId, pageLink, config) {
|
2019-11-08 11:49:43 +02:00
|
|
|
var deferred = $q.defer();
|
|
|
|
|
var url = '/api/edge/' + edgeId + '/devices?limit=' + pageLink.limit;
|
|
|
|
|
if (angular.isDefined(pageLink.idOffset)) {
|
2020-06-02 12:46:57 +03:00
|
|
|
url += '&offset=' + pageLink.idOffset;
|
2019-11-08 11:49:43 +02:00
|
|
|
}
|
|
|
|
|
$http.get(url, config).then(function success(response) {
|
|
|
|
|
deferred.resolve(response.data);
|
|
|
|
|
}, function fail() {
|
|
|
|
|
deferred.reject();
|
|
|
|
|
});
|
|
|
|
|
return deferred.promise;
|
|
|
|
|
}
|
2016-12-01 11:40:28 +02:00
|
|
|
}
|