import request from '@/service/request'

export const getOtaPkgPage = (params: IOT.API.OTA.QueryParams) => {
  return request<IOT.API.OTA.Detail[]>({
    url: '/otaPkg/page',
    method: 'GET',
    params
  })
}

export const getOtaPkgList = (params: IOT.API.OTA.QueryParams) => {
  return request<IOT.API.OTA.Detail[]>({
    url: '/otaPkg/list',
    method: 'GET',
    params
  })
}

export const addOtaPkg = (data: IOT.API.OTA.BodyParams) => {
  return request<string>({
    url: '/otaPkg',
    method: 'POST',
    data
  })
}

export const delOtaPkg = (id: string) => {
  return request<string>({
    url: `/otaPkg/${id}`,
    method: 'DELETE'
  })
}

export const getOtaPkgById = (id: string) => {
  return request<IOT.API.OTA.Detail>({
    url: `/otaPkg/${id}`,
    method: 'GET'
  })
}
