import request from '@/utils/request';

//获取列表数据
function getDevice(queryParams){
    return request({
    url: '/api/device/debug/list',
    method: 'get',
    params: queryParams
  })
}

//上传文件
function uploadFile(formData){
    return request({
    url: '/api/device/debug/addFile',
    method: 'post',
    data: formData
  })
}

//修改操作视频
function addVideo(formData){
    return request({
    url: '/api/device/debug/addVideo',
    method: 'post',
    data: formData
  })
}


//修改单个数据的多个文件
function updateItem(formData){
  
    return request({
    url: '/api/device/debug/editDebug',
    method: 'post',
    data: formData
  })
  //开发时假装成功
  // return new Promise((resolve,reject)=>{
  //    resolve({
  //     code:200,
  //     msg:"操作成功"
  //    });
  // });
}
//批量上传开机画面
function uploadBoot(formData){
   return request({
    url: '/api/device/debug/addLogo',
    method: 'post',
    data: formData
  })
  //开发时假装成功
  //  return new Promise((resolve, reject) => {
  //       //开机画面
  //       resolve({ code: 200, msg: '操作成功' });
  //     });
}

// 6170上传logo开机画面
function deviceUploadLogo(formData){
   return request({
    url: '/api/bjq/device/batchUploadLogo',
    method: 'post',
    data: formData
  })
}


function getDeviceInfoById(id){
     return request({
    url: '/api/device/debug/detail/'+id,
    method: 'get'
  })
}




export default{
    getDevice:getDevice,
    uploadFile:uploadFile,
    addVideo:addVideo,
    updateItem:updateItem,
    uploadBoot:uploadBoot,
    getDeviceInfoById:getDeviceInfoById,
    deviceUploadLogo:deviceUploadLogo
}