import request from '@/utils/request'

// 查询固件列表
export function list(params) {
    return request({
        url: '/system/firmware/list',
        method: 'get',
        params
    })
}

// 查询固件详细
export function Info(firmwareId) {
    return request({
      url: '/system/firmware/' + firmwareId,
      method: 'get'
    })
  }

// 新增固件
export function add(data) {
    return request({
        url: '/system/firmware',
        method: 'post',
        data
    })
}

// 修改固件
export function update(data) {
    return request({
        url: '/system/firmware',
        method: 'post',
        data
    })
}

// 删除固件
export function del(firmwareId) {
    return request({
        url: '/system/firmware/' + firmwareId,
        method: 'delete'
    })
}

/**
 * 启用固件
 * @param {Number} fileId 节点nodeId
 */
export function enable(fileId) {
    return request({
        url: '/system/firmware/enable',
        method: 'post',
        params: {fileId}
    })
}