import request from '@/utils/request'

// 查询巡更点列表
export function listPatrolPoint(query) {
    return request({
        url: '/patrol/point/list',
        method: 'get',
        params: query
    })
}

// 查询巡更点详细
export function getPatrolPoint(id) {
    return request({
        url: '/patrol/point/' + id,
        method: 'get'
    })
}

// 新增巡更点
export function addPatrolPoint(data) {
    return request({
        url: '/patrol/point',
        method: 'post',
        data: data
    })
}

// 修改巡更点
export function updatePatrolPoint(data) {
    return request({
        url: '/patrol/point',
        method: 'put',
        data: data
    })
}

// 删除巡更点
export function delPatrolPoint(id) {
    return request({
        url: '/patrol/point/' + id,
        method: 'delete'
    })
}

// 修改巡更点状态
export function changePointStatus(id, status) {
    const data = {
        id: id,
        isActive: status
    }
    return request({
        url: '/patrol/point/changeStatus',
        method: 'put',
        data: data
    })
}

// 导出巡更点
export function exportPatrolPoint(query) {
    return request({
        url: '/patrol/point/export',
        method: 'post',
        params: query
    })
}