import request from '@/utils/request'
import {Url} from "../utils/urlFormat";

export function getShpTable(params) {
  return request({
    url: '/ShpManager/SearchShpTable',
    method: 'get',
    params
  })
}

export function addShpTable(data) {
  return request({
    url: '/ShpManager/InsertShpData',
    method: 'post',
    data
  })
}

export function delShpTable(params) {
  return request({
    url: '/ShpManager/DeleteShpData',
    method: 'get',
    params
  })
}

export function LoadLayerManagerByUser(params) {
  return request({
    url: '/LayerManager/LoadLayerManagerByUser',
    method: 'get',
    params
  })
}

export function GetModel(params) {
  return request({
    url: '/LayerManager/GetModel',
    method: 'get',
    params
  })
}

export function GetShpModel(params) {
  return request({
    url: '/ShpManager/GetShpModel',
    method: 'get',
    params
  })
}

export function getMethodCommon(_url, params) {
  let urls = new Url()
  let new_url = urls.getUrl(_url, params)
  return request({
      url: new_url,
      method: 'GET',
  })
}
export function postMethodCommon(_url, data) {
  return request({
      url: _url,
      method: 'POST',
      data
  })
}
