import request from '@/utils/request'

// 创建农场资源分类
export function createResourceType(data) {
  return request({
    url: '/farm/resource-type/create',
    method: 'post',
    data: data
  })
}

// 更新农场资源分类
export function updateResourceType(data) {
  return request({
    url: '/farm/resource-type/update',
    method: 'put',
    data: data
  })
}

// 删除农场资源分类
export function deleteResourceType(id) {
  return request({
    url: '/farm/resource-type/delete?id=' + id,
    method: 'delete'
  })
}

// 获得农场资源分类
export function getResourceType(id) {
  return request({
    url: '/farm/resource-type/get?id=' + id,
    method: 'get'
  })
}

// 获得农场资源分类分页
export function getResourceTypePage(query) {
  return request({
    url: '/farm/resource-type/page',
    method: 'get',
    params: query
  })
}

// 导出农场资源分类 Excel
export function exportResourceTypeExcel(query) {
  return request({
    url: '/farm/resource-type/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
