import request from '@/utils/request'

// 查询触发器列表
export function listTrigger(query) {
    return request({
        url: '/iot/trigger/list',
        method: 'get',
        params: query
    })
}

// 查询触发器详细
export function getTrigger(triggerId) {
    return request({
        url: '/iot/trigger/' + triggerId,
        method: 'get'
    })
}

// 新增触发器
export function addTrigger(data) {
    return request({
        url: '/iot/trigger/add',
        method: 'post',
        data: data
    })
}

// 修改触发器
export function updateTrigger(data) {
    return request({
        url: '/iot/trigger/edit',
        method: 'put',
        data: data
    })
}

// 删除触发器
export function delTrigger(triggerId) {
    return request({
        url: '/iot/trigger/del/' + triggerId,
        method: 'delete'
    })
}

// 导出触发器
export function exportTrigger(query) {
    return request({
        url: '/iot/trigger/export',
        method: 'get',
        params: query
    })
}
