import request from '@/utils/request'

export function getRobotList(params) {
    return request({
        url: '/inspection/robot/list', 
        method: 'get',
        params: params
    })
}

export function addRobot(data) {
    return request({
        url: '/inspection/robot',
        method: 'post',
        data: data
    })
}

export function updateRobot(data) {
    return request({
        url: '/inspection/robot',
        method: 'put',
        data: data
    })
}

export function deleteRobot(id) {
    return request({
        url: `/inspection/robot/${id}`,
        method: 'delete'
    })
}

/**
 * 获取机器人地图
 * @param {*} robotId 
 * @returns 
 */
export function getMapByRobot(robotId) {
    return request({
        url: `/inspection/robot/${robotId}/maps`,
        method: 'get'
    })
}

/**
 * 获取地图JSON数据
 * @param {*} params 
 * @returns 
 */
export function getMapJson(params) {
    return request({
        url: `/inspection/robot/${params.robotId}/download-map`,
        method: 'get',
        params
    })
}