import request from '@/utils/request'

export function subscribe(query) {
    return request({
        url: '/api/mqtt/single',
        method: 'post',
        params: query
    })
}

export function unsubscribe(query) {
    return request({
        url: '/api/mqtt/single',
        method: 'delete',
        params: query
    })
}


export function batchUnsubscribe(query) {
    return request({
        url: '/api/mqtt/batchUnsubscribe',
        method: 'delete',
        params: query
    })
}

export function batchSubscribe(query) {
    return request({
        url: '/api/mqtt/batchSubscribe',
        method: 'post',
        params: query
    })
}

export function manualReconnect(query) {
    return request({
        url: '/api/mqtt/reconnect',
        method: 'get',
        params: query
    })
}

export function status() {
    return request({
        url: '/api/mqtt/batch',
        method: 'get'
    })
}


export function getAgriStatus(data) {
    return request({
        url: '/api/mqtt/getAgriStatus',
        method: 'post',
        data: data
    })
}
