import request from '@/utils/request';

//修改电子围栏
function updateFence(data) {
    return request({
        url: '/api/equipment/geoFence',
        method: 'put',
        data: data
    })
}

//新增电子围栏
function AddFence(data) {
    return request({
        url: '/api/equipment/geoFence',
        method: 'post',
        data: data
    })
}

//导出电子围栏列表
function exportFence (data){
    return request({
        url: '/api/equipment/geoFence/export',
        method: 'post',
        data: data
    })
}

//位置检查
function check(data) {
    return request({
        url: '/api/equipment/geoFence/check',
        method: 'post',
        data: data
    })
}

//获取电子围栏详细信息
function geoFenceById(id) {
    return request({
        url: '/api/equipment/geoFence/'+id,
        method: 'get'
    })
}

//查询电子围栏列表
function getList(data) {
    if(!data){
        data={pageNum:1,pageSize:9999};
    }
    return request({
        url: '/api/equipment/geoFence/list',
        method: 'get',
        params: data
    })
}

//删除电子围栏
function DelFence(ids) {
    return request({
        url: '/api/equipment/geoFence/' + ids,
        method: 'delete'
    })
}

//添加终端
function addTerminal(data){
  return request({
        url: '/api/equipment/geoFence/addTerminal',
        method: 'post',
        data: data
    })
}

//删除终端
function delTerminal(data){
 return request({
        url: '/api/equipment/geoFence/delTerminal',
        method: 'post',
        data:data
    })
}

//查询终端
function pageTerminal(data){
    return request({
        url:'api/device/pageTerminal',
        method:'get',
        params:data
    });
}


export default{
    updateFence:updateFence,
    AddFence:AddFence,
    exportFence:exportFence,
    check:check,
    geoFenceById:geoFenceById,
    getList:getList,
    DelFence:DelFence,
    addTerminal:addTerminal,
    delTerminal:delTerminal,
    pageTerminal:pageTerminal
}


