import request from '@/utils/request'

// 创建农场任务事件
export function createEvent(data) {
  return request({
    url: '/farm/event/create',
    method: 'post',
    data: data
  })
}

// 更新农场任务事件
export function updateEvent(data) {
  return request({
    url: '/farm/event/update',
    method: 'put',
    data: data
  })
}

// 删除农场任务事件
export function deleteEvent(id) {
  return request({
    url: '/farm/event/delete?id=' + id,
    method: 'delete'
  })
}

// 获得农场任务事件
export function getEvent(id) {
  return request({
    url: '/farm/event/get?id=' + id,
    method: 'get'
  })
}

// 获得农场任务事件分页
export function getEventPage(query) {
  return request({
    url: '/farm/event/page',
    method: 'get',
    params: query
  })
}

// 搜索条件获得农场任务事件分页
export function getEventSearchPage(query) {
  return request({
    url: '/farm/event/pageSearch',
    method: 'get',
    params: query
  })
}

// 导出农场任务事件 Excel
export function exportEventExcel(query) {
  return request({
    url: '/farm/event/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
