import request from 'libs/request'

/*
** @decs 获取小区列表
*/
export function fetchEstateList (data={}) {
  const defaultParams = {
    page_size: 10,
    page_num: 1,
    province: '',
    city: '',
    district: '',
    query_name: data.searchKey || ''
  }
  return request.get('estate/queryAll', {params: Object.assign(defaultParams, data)})
}

export function createEstate (data) {
  return request.post('estate/add', data)
}

export function fetchEstateDetail (estate_id) {
  return request.get('estate/detail', { params: {estate_id} })
}

export function updateEstate (data) {
  return request.post('estate/update', data)
}

export function deleteEstate (strIds) {
  return request.post('estate/delete', { strIds })
}