import request from '@/utils/request'

// 创建
export function createCropRecord(data) {
  return request({
    url: '/farm/crop-record/create',
    method: 'post',
    data: data
  })
}

// 更新
export function updateCropRecord(data) {
  return request({
    url: '/farm/crop-record/update',
    method: 'put',
    data: data
  })
}

// 删除
export function deleteCropRecord(id) {
  return request({
    url: '/farm/crop-record/delete?id=' + id,
    method: 'delete'
  })
}

// 获得
export function getCropRecord(id) {
  return request({
    url: '/farm/crop-record/get?id=' + id,
    method: 'get'
  })
}

// 获得分页
export function getCropRecordPage(query) {
  return request({
    url: '/farm/crop-record/page',
    method: 'get',
    params: query
  })
}

// 导出 Excel
export function exportCropRecordExcel(query) {
  return request({
    url: '/farm/crop-record/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
