import request from '@/utils/request'

export function getAllRoom() {
  const params = {
    page: 0,
    size: 9999,
    enabled: true
  }
  return request({
    url: 'api/dmMeetingRoom',
    method: 'get',
    params
  })
}
//查询所有
export function getRoom(params) {
  return request({
    url: 'api/dmMeetingRoom',
    method: 'get',
    params
  })
}
//新增
export function add(data) {
  return request({
    url: 'api/dmMeetingRoom',
    method: 'post',
    data
  })
}
//删除
export function del(ids) {
  return request({
    url: 'api/dmMeetingRoom/',
    method: 'delete',
    data: ids
  })
}

//修改
export function edit(data) {
  return request({
    url: 'api/dmMeetingRoom',
    method: 'put',
    data
  })
}

//查询会议室视图
export function viewList(params) {
  return request({
    url: 'api/dmMeetingRoom/viewList',
    method: 'get',
    params
  })
}
//会议室视图详情
export function viewInfo(data) {
  console.info('viewInfo || data ==>> ' + data)
  return request({
    url: 'api/dmMeetingRoom/viewInfo?roomId=' + data,
    // url: 'api/dmMeetingRoom/viewInfo',
    method: 'get'/* ,
    data */
  })
}

// 会议室使用情况(查询:会议室总数/正在使用会议室数量/空闲会议室数量)
export function roomSummary() {
  return request({
    url: 'api/dmMeetingRoom/roomSummary',
    method: 'get'
  })
}

export default { add, edit, del, viewList, viewInfo, roomSummary,getRoom }
