import { defHttp } from '@/utils/http/axios';
enum Api {
  GetUserOrgs = '/api/Check/GetOrgs',
  GetCenterPoints = '/api/IdleLand/GetCenterPoints'
}

export function getUserOrgs(params){
  return defHttp.get({ url: Api.GetUserOrgs, params });
}
export function getDetail(params,type){
  let url = ''
  switch(type){
    case 3:
      url = '/api/IdleLand/Detail'
      break;
    case 2:
      url = '/api/IdleHouse/Detail'
      break;
    case 1:
      url = '/api/IdleFarming/Detail'
      break;
    case 5:
      url = '/api/IdleWaters/Detail'
      break;
    case 4:
      url = '/api/IdleNongji/Detail'
      break;
  }
  return defHttp.get({ url, params });
}
export function getPageList(params, type){
  let url = ''
  switch(type){
    case 3:
      url = '/api/IdleLand/LoadPage'
      break;
    case 2:
      url = '/api/IdleHouse/LoadPage'
      break;
    case 1:
      url = '/api/IdleFarming/LoadPage'
      break;
    case 5:
      url = '/api/IdleWaters/LoadPage'
      break;
  }
  return defHttp.get({ url, params });
}
export function getPolygonCenter(params){
  return defHttp.get({ url: Api.GetCenterPoints, params });
}