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

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