import request from '@/utils/request'

// 查询分配记录列表
export function listRecords(query) {
  return request({
    url: '/qw/record/list',
    method: 'get',
    params: query
  })
}

// 查询分配记录详细
export function getRecords(id) {
  return request({
    url: '/qw/record/' + id,
    method: 'get'
  })
}

// 新增分配记录
export function addRecords(data) {
  return request({
    url: '/qw/record',
    method: 'post',
    data: data
  })
}

// 修改分配记录
export function updateRecords(data) {
  return request({
    url: '/qw/record',
    method: 'put',
    data: data
  })
}

// 删除分配记录
export function delRecords(id) {
  return request({
    url: '/qw/record/' + id,
    method: 'delete'
  })
}

// 导出分配记录
export function exportRecords(query) {
  return request({
    url: '/qw/record/export',
    method: 'get',
    params: query
  })
}

export function apply(applyCount) {
  return request({
    url: '/qw/record/apply',
    method: 'get',
    params: applyCount
  })
}
// 新增分配记录
//@PostMapping("/batchUpdate")
// public AjaxResult batchUpdate(@RequestBody Long[] ids)
//后端接收结构
export function batchUpdate(data) {
  return request({
    url: '/qw/record/batchUpdate',
    method: 'post',
    data: data
  })
}
// 获取服务器信息
export function getServerInfo(id) {
  return request({
    url: '/qw/record/server/' + id,
    method: 'get'
  })
}
export function release(data) {
  return request({
    url: '/qw/record/release',
    method: 'post',
    data: data
  })
}