import request from '@/utils/request'

// 查询平台分类列表（分页）
export function listCategory(query) {
  return request({
    url: '/agri/category/list',
    method: 'get',
    params: query
  })
}

// 查询平台分类树
export function treeCategory() {
  return request({
    url: '/agri/category/tree',
    method: 'get'
  })
}

// 一级分类下拉
export function level1Options() {
  return request({
    url: '/agri/category/level1Options',
    method: 'get'
  })
}

// 新增分类
export function addCategory(data) {
  return request({
    url: '/agri/category',
    method: 'post',
    data: data
  })
}

// 修改分类
export function updateCategory(data) {
  return request({
    url: '/agri/category',
    method: 'put',
    data: data
  })
}

// 删除分类
export function delCategory(categoryIds) {
  return request({
    url: '/agri/category/' + categoryIds,
    method: 'delete'
  })
}
