const request = uni.$u.http

export async function cate(params) {
  return request.get(
    'product/cate',
    { params }
  )
}

export async function search(params) {
  return request.get(
    'product/search',
    { params }
  )
}

export async function detail(id) {
  return request.get(
    `product/${id}/detail`
  )
}

export async function viewer(id) {
  return request.post(
    `product/${id}/viewer`
  )
}

export async function download(id) {
  return request.post(
    `product/${id}/download`
  )
}

export default {
  cate,
  search,
  detail,
  viewer,
  download
}
