import request from '@/utils/request'

// 创建农场项目
export function createProject(data) {
  return request({
    url: '/farm/project/create',
    method: 'post',
    data: data
  })
}

// 更新农场项目
export function updateProject(data) {
  return request({
    url: '/farm/project/update',
    method: 'put',
    data: data
  })
}

// 删除农场项目
export function deleteProject(id) {
  return request({
    url: '/farm/project/delete?id=' + id,
    method: 'delete'
  })
}

// 获得农场项目
export function getProject(id) {
  return request({
    url: '/farm/project/get?id=' + id,
    method: 'get'
  })
}

// 获得农场项目分页
export function getProjectPage(query) {
  return request({
    url: '/farm/project/page',
    method: 'get',
    params: query
  })
}

// 搜索条件获得农场项目分页
export function getProjectSearchPage(query) {
  return request({
    url: '/farm/project/pageSearch',
    method: 'get',
    params: query
  })
}

// 导出农场项目 Excel
export function exportProjectExcel(query) {
  return request({
    url: '/farm/project/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
