diff --git a/src/api/system/datasource.js b/src/api/system/datasource.js new file mode 100644 index 00000000..183b1be2 --- /dev/null +++ b/src/api/system/datasource.js @@ -0,0 +1,97 @@ +import request from '@/utils/request' + +// 查询园区数据库列表 +export function listDatasource(query) { + return request({ + url: '/system/datasource/list', + method: 'get', + params: query + }) +} + +// 查询园区数据库详细 +export function getDatasource(id) { + return request({ + url: '/system/datasource/' + id, + method: 'get' + }) +} + +// 新增园区数据库 +export function addDatasource(data) { + return request({ + url: '/system/datasource', + method: 'post', + data: data + }) +} + +// 修改园区数据库 +export function updateDatasource(data) { + return request({ + url: '/system/datasource', + method: 'put', + data: data + }) +} + +// 删除园区数据库 +export function delDatasource(id) { + return request({ + url: '/system/datasource/' + id, + method: 'delete' + }) +} + +/***********数据源分配用户*********** */ + +// 查询角色已授权用户列表 +export function allocatedUserList(query) { + return request({ + url: '/system/datasource/authUser/allocatedList', + method: 'get', + params: query + }) +} + +// 查询角色未授权用户列表 +export function unallocatedUserList(query) { + return request({ + url: '/system/datasource/authUser/unallocatedList', + method: 'get', + params: query + }) +} +// 授权用户选择 +export function authUserSelectAll(data) { + return request({ + url: '/system/datasource/authUser/selectAll', + method: 'put', + params: data + }) +} +// 取消用户授权角色 +export function authUserCancel(data) { + return request({ + url: '/system/datasource/authUser/cancel', + method: 'put', + data: data + }) +} + +// 批量取消用户授权角色 +export function authUserCancelAll(data) { + return request({ + url: '/system/datasource/authUser/cancelAll', + method: 'put', + params: data + }) +} +//测试激活数据库链接 +export function changeDBStatus(datasourceId) { + return request({ + url: '/system/datasource/changeDBStatus/' + datasourceId, + method: 'get' + }) +} +