import request from '@/utils/request'

// 查询硬件数据库列表
export function listLibrary(query) {
    return request({
        url: '/iot/library/list',
        method: 'get',
        params: query
    })
}

// 查询硬件数据库详细
export function getLibrary(devId) {
    return request({
        url: '/iot/library/' + devId,
        method: 'get'
    })
}

// 新增硬件数据库
export function addLibrary(data) {
    return request({
        url: '/iot/library',
        method: 'post',
        data: data
    })
}

// 修改硬件数据库
export function updateLibrary(data) {
    return request({
        url: '/iot/library',
        method: 'put',
        data: data
    })
}

// 删除硬件数据库
export function delLibrary(devId) {
    return request({
        url: '/iot/library/' + devId,
        method: 'delete'
    })
}

// 导出硬件数据库
export function exportLibrary(query) {
    return request({
        url: '/iot/library/export',
        method: 'get',
        params: query
    })
}

// 导出硬件数据库 /csv
export function exportLibraryCsv(query) {
  return request({
      url: '/iot/library/export/csv',
      method: 'get',
      params: query
  })
}


// 下载用户导入模板
export function importTemplate() {
  return request({
    url: '/iot/library/importTemplate',
    method: 'get'
  })
}
