import request from '@/config/axios'

// app版本更新 VO
export interface IotAppVO {
  id: number // 主键
  appVersion: string // app版本号
  url: string // app的apk路径
  remark: string // 备注
  appName: string // app包名称
}

// app版本更新 API
export const IotAppApi = {
  // 查询app版本更新分页
  getIotAppPage: async (params: any) => {
    return await request.get({ url: `/rq/iot-app/page`, params })
  },

  // 查询app版本更新详情
  getIotApp: async (id: number) => {
    return await request.get({ url: `/rq/iot-app/get?id=` + id })
  },

  // 新增app版本更新
  createIotApp: async (data: IotAppVO) => {
    return await request.post({ url: `/rq/iot-app/create`, data })
  },

  // 修改app版本更新
  updateIotApp: async (data: IotAppVO) => {
    return await request.put({ url: `/rq/iot-app/update`, data })
  },

  // 删除app版本更新
  deleteIotApp: async (id: number) => {
    return await request.delete({ url: `/rq/iot-app/delete?id=` + id })
  },

  // 导出app版本更新 Excel
  exportIotApp: async (params) => {
    return await request.download({ url: `/rq/iot-app/export-excel`, params })
  },
}
