const request = uni.$u.http

export function recommend() {
  return request.get(
    'episode/recommend'
  )
}

export function news() {
  return request.get(
    'episode/news'
  )
}

export function rank() {
  return request.get(
    'episode/rank'
  )
}

export function todayRecommend() {
  return request.get(
    'episode/today/recommend'
  )
}

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

export function trace() {
  return request.get(
    'episode/trace'
  )
}

export function list(params) {
  return request.get(
    'episode/list',
    { params }
  )
}

export function shared(id) {
  return request.post(
    `episode/${id}/shared`
  )
}

export function search(params) {
  return request.get(
    `episode/search`,
    { params }
  )
}

export function vipFree(params) {
  return request.get(
    `episode/vip/free`,
    { params }
  )
}

export function listBuyNum(list_id) {
  return request.get(
    `episode/list/${list_id}/buyNum`
  )
}

export default {
  recommend,
  news,
  rank,
  todayRecommend,
  detail,
  trace,
  list,
  shared,
  search,
  vipFree,
  listBuyNum
}
