Initial Commit
This commit is contained in:
Vendored
+271
@@ -0,0 +1,271 @@
|
||||
angular.module('app')
|
||||
|
||||
.factory('SottoAree', function ($resource) {
|
||||
const resource = $resource(basePath + 'sottoaree/:id', {id: '@id'}, {
|
||||
update: {method: 'PUT'},
|
||||
insert: {method: 'POST'},
|
||||
getList: {
|
||||
method: 'GET',
|
||||
url: basePath + 'sottoaree',
|
||||
transformResponse: function (result,headers) {
|
||||
let res = {};
|
||||
res.data = angular.fromJson(result);
|
||||
res.headers = headers();
|
||||
return res;
|
||||
}
|
||||
},
|
||||
getByCodice: {
|
||||
method: 'GET',
|
||||
url: basePath + 'sottoaree/m/get-by-codice'
|
||||
}
|
||||
});
|
||||
return {
|
||||
get: function (success, error) {
|
||||
return resource.query(success, error);
|
||||
},
|
||||
find: function (id) {
|
||||
return resource.get({id: id}).$promise;
|
||||
},
|
||||
insert: function (data) {
|
||||
return resource.insert(data).$promise;
|
||||
},
|
||||
update: function (data) {
|
||||
return resource.update(data).$promise;
|
||||
},
|
||||
delete: function (id) {
|
||||
return resource.delete({id: id}).$promise;
|
||||
},
|
||||
getList: function (data) {
|
||||
return resource.getList(data).$promise;
|
||||
},
|
||||
getByCodice: function (codice) {
|
||||
return resource.getByCodice({Codice: codice}).$promise;
|
||||
}
|
||||
};
|
||||
})
|
||||
|
||||
.factory('Users', function ($resource) {
|
||||
const resource = $resource(basePath + 'users/:id', {id: '@id'}, {
|
||||
update: {method: 'PUT'},
|
||||
insert: {method: 'POST'},
|
||||
getUserData: {
|
||||
method: 'GET',
|
||||
url: basePath + 'users/m/get-user-info',
|
||||
transformResponse: function (result,headers) {
|
||||
let res = {};
|
||||
res.data = angular.fromJson(result);
|
||||
res.headers = headers();
|
||||
return res;
|
||||
}
|
||||
},
|
||||
getList: {
|
||||
method: 'GET',
|
||||
url: basePath + 'users',
|
||||
transformResponse: function (result,headers) {
|
||||
let res = {};
|
||||
res.data = angular.fromJson(result);
|
||||
res.headers = headers();
|
||||
return res;
|
||||
}
|
||||
},
|
||||
proponiCodiceUtente: {
|
||||
method: 'GET',
|
||||
url: basePath + 'users/m/get-codice'
|
||||
},
|
||||
caricaRidersMt: {
|
||||
method: 'GET',
|
||||
url: basePath + 'users/m/get-riders-mt',
|
||||
transformResponse: function (result,headers) {
|
||||
let res = {};
|
||||
res.data = angular.fromJson(result);
|
||||
res.headers = headers();
|
||||
return res;
|
||||
}
|
||||
},
|
||||
});
|
||||
return {
|
||||
get: function (success, error) {
|
||||
return resource.query(success, error);
|
||||
},
|
||||
find: function (id) {
|
||||
return resource.get({id: id}).$promise;
|
||||
},
|
||||
getByToken: function (token) {
|
||||
return resource.getList({token: token}).$promise;
|
||||
},
|
||||
getUserData: function () {
|
||||
return resource.getUserData().$promise;
|
||||
},
|
||||
insert: function (data) {
|
||||
return resource.insert(data).$promise;
|
||||
},
|
||||
update: function (data) {
|
||||
return resource.update(data).$promise;
|
||||
},
|
||||
delete: function (id) {
|
||||
return resource.delete({id: id}).$promise;
|
||||
},
|
||||
getList: function (data) {
|
||||
return resource.getList(data).$promise;
|
||||
},
|
||||
proponiCodiceUtente: function (role) {
|
||||
return resource.proponiCodiceUtente({role: role}).$promise;
|
||||
},
|
||||
caricaRidersMt: function () {
|
||||
return resource.caricaRidersMt().$promise;
|
||||
}
|
||||
};
|
||||
})
|
||||
|
||||
.factory('FasceOrarie', function ($resource) {
|
||||
const resource = $resource(basePath + 'fasceorarie/:id', {id: '@id'}, {
|
||||
update: {method: 'PUT'},
|
||||
insert: {method: 'POST'},
|
||||
getList: {
|
||||
method: 'GET',
|
||||
url: basePath + 'fasceorarie',
|
||||
transformResponse: function (result,headers) {
|
||||
let res = {};
|
||||
res.data = angular.fromJson(result);
|
||||
res.headers = headers();
|
||||
return res;
|
||||
}
|
||||
}
|
||||
});
|
||||
return {
|
||||
get: function (success, error) {
|
||||
return resource.query(success, error);
|
||||
},
|
||||
find: function (id) {
|
||||
return resource.get({id: id}).$promise;
|
||||
},
|
||||
insert: function (data) {
|
||||
return resource.insert(data).$promise;
|
||||
},
|
||||
update: function (data) {
|
||||
return resource.update(data).$promise;
|
||||
},
|
||||
delete: function (id) {
|
||||
return resource.delete({id: id}).$promise;
|
||||
},
|
||||
getList: function (data) {
|
||||
return resource.getList(data).$promise;
|
||||
}
|
||||
};
|
||||
})
|
||||
|
||||
.factory('TipologieAttivita', function ($resource) {
|
||||
const resource = $resource(basePath + 'tipologieattivita/:id', {id: '@id'}, {
|
||||
update: {method: 'PUT'},
|
||||
insert: {method: 'POST'},
|
||||
getList: {
|
||||
method: 'GET',
|
||||
url: basePath + 'tipologieattivita',
|
||||
transformResponse: function (result,headers) {
|
||||
let res = {};
|
||||
res.data = angular.fromJson(result);
|
||||
res.headers = headers();
|
||||
return res;
|
||||
}
|
||||
}
|
||||
});
|
||||
return {
|
||||
get: function (success, error) {
|
||||
return resource.query(success, error);
|
||||
},
|
||||
find: function (id) {
|
||||
return resource.get({id: id}).$promise;
|
||||
},
|
||||
insert: function (data) {
|
||||
return resource.insert(data).$promise;
|
||||
},
|
||||
update: function (data) {
|
||||
return resource.update(data).$promise;
|
||||
},
|
||||
delete: function (id) {
|
||||
return resource.delete({id: id}).$promise;
|
||||
},
|
||||
getList: function (data) {
|
||||
return resource.getList(data).$promise;
|
||||
}
|
||||
};
|
||||
})
|
||||
|
||||
.factory('Ordini', function ($resource) {
|
||||
const resource = $resource(basePath + 'ordini/:id', {id: '@id'}, {
|
||||
update: {method: 'PUT'},
|
||||
insert: {method: 'POST'},
|
||||
getList: {
|
||||
method: 'GET',
|
||||
url: basePath + 'ordini',
|
||||
transformResponse: function (result,headers) {
|
||||
let res = {};
|
||||
res.data = angular.fromJson(result);
|
||||
res.headers = headers();
|
||||
return res;
|
||||
}
|
||||
},
|
||||
getOrdiniDaGestire: {
|
||||
method: 'GET',
|
||||
url: basePath + 'ordiniadmin',
|
||||
transformResponse: function (result,headers) {
|
||||
let res = {};
|
||||
res.data = angular.fromJson(result);
|
||||
res.headers = headers();
|
||||
return res;
|
||||
}
|
||||
},
|
||||
checkStatoOrdiniSync: {
|
||||
method: 'GET',
|
||||
url: basePath + 'ordiniadmin/m/check-ordini-sync',
|
||||
},
|
||||
setStatoOrdiniSync: {
|
||||
method: 'GET',
|
||||
url: basePath + 'ordiniadmin/m/set-ordini-sync',
|
||||
},
|
||||
resetMtDashboard: {
|
||||
method: 'GET',
|
||||
url: basePath + 'ordiniadmin/m/reset-mt-dashboard',
|
||||
},
|
||||
getGraphData: {
|
||||
method: 'GET',
|
||||
url: basePath + 'ordiniadmin/m/get-graph-data',
|
||||
}
|
||||
});
|
||||
return {
|
||||
get: function (success, error) {
|
||||
return resource.query(success, error);
|
||||
},
|
||||
find: function (id) {
|
||||
return resource.get({id: id}).$promise;
|
||||
},
|
||||
insert: function (data) {
|
||||
return resource.insert(data).$promise;
|
||||
},
|
||||
update: function (data) {
|
||||
return resource.update(data).$promise;
|
||||
},
|
||||
delete: function (id) {
|
||||
return resource.delete({id: id}).$promise;
|
||||
},
|
||||
getList: function (data) {
|
||||
return resource.getList(data).$promise;
|
||||
},
|
||||
getOrdiniDaGestire: function (data) {
|
||||
return resource.getOrdiniDaGestire(data).$promise;
|
||||
},
|
||||
checkStatoOrdiniSync: function () {
|
||||
return resource.checkStatoOrdiniSync().$promise;
|
||||
},
|
||||
setStatoOrdiniSync: function (stato) {
|
||||
return resource.setStatoOrdiniSync({s: stato}).$promise;
|
||||
},
|
||||
resetMtDashboard: function () {
|
||||
return resource.resetMtDashboard().$promise;
|
||||
},
|
||||
getGraphData: function (periodo) {
|
||||
return resource.getGraphData({p: periodo}).$promise;
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user