
/**
 * Created by JianJia.Zhou<jianjia.zhou> on 2022/8/22.
 */
const request = uni.$u.http

export function record(params) {
  return request.get(
    'user/watch/record',
    { params }
  )
}
export function deleteRecord(id) {
  return request.post(
    `user/watch/${id}/destroy`
  )
}

export function recent() {
  return request.get(
    'user/watch/recent'
  )
}

export function watched(id, list_id) {
  return request.post(
    'user/watch/episode',
    { id, list_id }
  )
}

export async function buyRecord(episode_id) {
  return request.get(
    `user/episode/buy/${episode_id}/record`
  )
}

export async function buyHandle(episode_id, list_id) {
  return request.post(
    `user/episode/${episode_id}/${list_id}/buy`
  )
}
export default {
  recent,
  record,
  deleteRecord,
  watched,
  buyRecord,
  buyHandle
}
