import request from '@/router/axios'

export function fetchList(url, query) {
  return request({
    url: url,
    method: 'get',
    params: query
  })
}

export function addResult(url, obj) {
  return request({
    url: url,
    method: 'post',
    data: obj
  })
}

export function getResult(url, id) {
  return request({
    url: url + '/' + id,
    method: 'get'
  })
}



export function delResult(url, id) {
  return request({
    url: url + '/' + id,
    method: 'delete'
  })
}

export function putResult(url, obj) {
  return request({
    url: url,
    method: 'put',
    data: obj
  })
}

// 导出
export function exportResult(url, obj) {
  return request({
    url: url,
    method: 'post',
    data: obj,
    responseType: 'blob'
  })
}
// 导出
export function exportAll(url, query) {
  return request({
    url: url,
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}