import request from '@/utils/request'
import {download} from '@/utils/request'

// 查询摄像头配置列表
export function listCameraConfig(query) {
    return request({
        url: '/cameraConfig/cameraConfig/list',
        method: 'get',
        params: query
    })
}

// 查询摄像头配置详细
export function getCameraConfig(cameraConfigId) {
    return request({
        url: '/cameraConfig/cameraConfig/' + cameraConfigId,
        method: 'get'
    })
}

// 新增摄像头配置
export function addCameraConfig(data) {
    return request({
        url: '/cameraConfig/cameraConfig',
        method: 'post',
        data: data
    })
}

// 修改摄像头配置
export function updateCameraConfig(data) {
    return request({
        url: '/cameraConfig/cameraConfig',
        method: 'put',
        data: data
    })
}

// 删除摄像头配置
export function delCameraConfig(cameraConfigId) {
    return request({
        url: '/cameraConfig/cameraConfig/' + cameraConfigId,
        method: 'delete'
    })
}

// 导出摄像头配置
export function downloadCameraConfig(data) {
    download(
        '/cameraConfig/cameraConfig/export',
        data,
        `cameraConfig_${new Date().getTime()}.xlsx`)
}
