import request from '@/utils/request';

// 农户列表
export const getFarmerList = (query) => {
  return request({
    url: '/wpr/farmer/list',
    method: 'get',
    params: query
  });
};

// 新增

export const addFarmer = (data) => {
  return request({
    url: '/wpr/farmer/add',
    method: 'post',
    data
  });
};

// 修改

export const editFarmer = (data) => {
  return request({
    url: '/wpr/farmer/edit',
    method: 'put',
    data
  });
};

// 删除

export const deleteFarmer = (farmerIds) => {
  return request({
    url: '/wpr/farmer/delete/',
    method: 'delete',
    params: farmerIds
  });
};

// 详情

export const getFarmerDetail = (query) => {
  return request({
    url: '/wpr/farmer/info',
    method: 'get',
    params: query
  });
};
