// web service proxy for role webservices.factory('roleService', ['$http', 'apiConfig', function ($http, apiConfig) { 'use strict'; return { getRoleListByServiceGroup: function () { return $http.get('/role/displayByServiceGroup', apiConfig.create()); }, getUsersByRoleID: function (roleId) { return $http.get('/role/getUsersByRoleID?roleId=' + roleId, apiConfig.create()); }, getExtraUsersByRoleID: function (roleId) { return $http.get('/role/getExtraUsersByRoleID?roleId=' + roleId, apiConfig.create()); }, getRoleListByRoleTypeId: function (roleTypeId) { return $http.get('/role/displayByRoleType?roleTypeId=' + roleTypeId, apiConfig.create()); }, getSingleRole: function (roleId) { return $http.get('/role/displaySingle?roleId=' + roleId, apiConfig.create()); }, addRole: function (role) { return $http.post('/role/add', role, apiConfig.create()); }, updateRole: function (updateRole, roleId) { return $http.put('/role/update?roleID=' + roleId, updateRole, apiConfig.create()); }, deleteRole: function (role) { return $http.post('/role/delete', role, apiConfig.create()); }, deleteRoles: function (roleList) { return $http.post('/role/deleteRoleList', { roleList: roleList }, apiConfig.create()); }, checkRoleExist: function (roleId) { return $http.get('/role/exist?roleId=' + roleId, apiConfig.create()); }, checkReference: function (roleID) { return $http.get('/role/checkReferenceforRole?roleID=' + roleID, apiConfig.create()); }, getroletree: function (serviceTypeID) { return $http.get('/role/getroletree?serviceTypeID=' + serviceTypeID, apiConfig.create()); }, getRoleTreeList: function () { return $http.get('/role/getRoleTreeList', apiConfig.create()); }, getUserRoleList: function (organizationID, dimensionID, dimensionValueID) { return $http.get('/role/getUserRoleList?organizationID=' + organizationID + '&dimensionID=' + dimensionID + '&dimensionValueID=' + dimensionValueID, apiConfig.create()); }, getAllUserRoleList: function () { return $http.get('/role/getAllUserRoleList', apiConfig.create()); }, getAllUserRoleListByUserID: function (userID) { return $http.get('/role/getAllUserRoleListByUserID?userID=' + userID, apiConfig.create()); }, //用户下面多个角色,多少个机构 getDimensionUserRoleList: function (dimensionID, dimensionValueID) { return $http.get('/role/getDimensionUserRoleList?dimensionID=' + dimensionID + '&dimensionValueID=' + dimensionValueID, apiConfig.create()); }, getDimensionRoleUserList: function (dimensionID, dimensionValueID) { return $http.get('/role/getDimensionRoleUserList?dimensionID=' + dimensionID + '&dimensionValueID=' + dimensionValueID, apiConfig.create()); }, getAllOwnUserRoleList: function () { return $http.get('/role/getAllOwnUserRoleList', apiConfig.create()); }, removeUserRole: function (userID, roleIDList, serviceTypeID) { return $http.post('/role/removeUserRole?userID=' + userID + '&serviceTypeID=' + serviceTypeID, roleIDList, apiConfig.create()); }, getAllRoleListByUserID: function (userID, serviceTypeID) { return $http.get('/role/getAllRoleListByUserID?userID=' + userID + '&serviceTypeID=' + serviceTypeID, apiConfig.create()); }, updateUserRole: function (userRoleUpdteModel) { return $http.post('/role/updateUserRole', userRoleUpdteModel, apiConfig.create()); }, updateDimensionValues: function (dimensionValueModel) { return $http.post('/role/updateDimensionValues', dimensionValueModel, apiConfig.create()); }, updateUserOrg: function (orgIdList, userID) { return $http.post('/role/updateUserOrg?userID=' + userID, orgIdList, apiConfig.create()); }, validateRoleNameUnique: function (roleName, oldRoleName) { return $http.get('/role/validateRoleNameUnique?roleName=' + roleName + '&oldRoleName=' + oldRoleName, apiConfig.create({ ignoreLoadingBar: true })); }, addRoleCategory: function (name, roleCategoryID) { return $http.get('/role/addRoleCategory?name=' + encodeURI(name) + '&roleCategoryID=' + roleCategoryID, apiConfig.create({ ignoreLoadingBar: false })); }, updateRoleCategory: function (updateName, id) { return $http.get('/role/updateRoleCategory?updateName=' + encodeURI(updateName) + '&id=' + id, apiConfig.create({ ignoreLoadingBar: false })); }, deleteRoleCategory: function (id) { return $http.get('/role/deleteRoleCategory?id=' + id, apiConfig.create({ ignoreLoadingBar: false })); }, getAllRolePermission: function (serviceTypeID) { return $http.get('/role/getAllRolePermission?serviceTypeID=' + serviceTypeID, apiConfig.create()); }, getActiveUserRoleListByAreaID: function (areaId) { return $http.get('/role/getActiveUserRoleListByAreaID?areaID=' + areaId, apiConfig.create()); } }; }]);