import request from '@/utils/request';

/**
 * 用户列表
 * @param queryParams
 */
export function getGroupList(queryParams: any) {
  return request({
    url: '/group/pageList',
    method: 'post',
    data: queryParams,
  });
}
/**
* 用户新增
* */
export function addGroup(data: any) {
  return request({
    url: '/group/add',
    method: 'post',
    data: data,
  });
}
/**
 * 用户编辑
 * */
export function updateGroup(data: any) {
  return request({
    url: '/group/update',
    method: 'post',
    data: data,
  });
}

/**
 * 启用
 */
export function enableGroup(data: any) {
  return request({
    url: '/group/enable',
    method: 'post',
    data: data,
  });
}
/**
 * 禁用
 */
export function disableGroup(data: any) {
  return request({
    url: '/group/disable',
    method: 'post',
    data: data,
  });
}
// 获取用户清单
export function getLinkUser(data: any) {
  return request({
    url: '/group/user/list',
    method: 'post',
    data: data,
  });
}
// 删除关联用户
export function deleteLinkUserData(data: any) {
  return request({
    url: '/group/user/delete',
    method: 'post',
    data: data,
  });
}
// 获取所有启用的用户
export function enableUserList(data: any) {
  return request({
    url: '/user/select',
    method: 'post',
    data: data,
  });
}
// 保存用户组关联的用户
export function saveLinkUserData(data: any) {
  return request({
    url: '/group/user/save',
    method: 'post',
    data: data,
  });
}

// 获取角色清单
export function getLinkRole(data: any) {
  return request({
    url: '/group/role/list',
    method: 'post',
    data: data,
  });
}
// 删除关联角色
export function deleteLinkRoleData(data: any) {
  return request({
    url: '/group/role/delete',
    method: 'post',
    data: data,
  });
}
// 获取所有启用的角色
export function enableRoleList(data: any) {
  return request({
    url: '/role/select',
    method: 'post',
    data: data,
  });
}
// 保存用户组关联的角色
export function saveLinkRoleData(data: any) {
  return request({
    url: '/group/role/save',
    method: 'post',
    data: data,
  });
}
