import request from '@/utils/request';

export function getList(data) {
  return request({
    url: '/alarmUser/list?page=' + data.page + '&size=' + data.size,
    method: 'get',
    data,
  });
}

export function doEdit(data) {
  return request({
    url: '/alarmUser/update',
    method: 'post',
    data,
  });
}

export function doDelete(data) {
  return request({
    url: '/alarmUser/remove?userId=' + data.userId,
    method: 'post',
    data,
  });
}

export function doAdd(data) {
  return request({
    url: '/alarmUser/insert',
    method: 'post',
    data,
  });
}
//根据用户id查询报警站点列表
export function alarmProjects(data) {
  return request({
    url: '/alarmUser/alarmProjectIds?userId=' + data.userId,
    method: 'get',
    data,
  });
}
//查询所有项目
export function allProject(data) {
  return request({
    url: '/alarmUser/allProjects',
    method: 'get',
    data,
  });
}
//将该用户添加到站点报警联系人中
export function assignToProjects(data) {
  return request({
    url: '/alarmUser/addProjects',
    method: 'post',
    data,
  });
}
