import request from '@/utils/request'

// 列表
export function productGetList() {
  return request({
    url: '/detail/index',
    method: 'get'
  })
}

// 添加
export function productAdd(data) {
  return request({
    url: '/detail/store',
    method: 'post',
    data
  })
}

// 删除
export function productDetail(data) {
  return request({
    url: '/detail/destroy',
    method: 'post',
    data
  })
}

// 修改
export function productEdit(data) {
  return request({
    url: '/detail/update',
    method: 'post',
    data
  })
}

// 上传视频
export function uploadProductVideo(data, fn) {
  return request({
    url: '/detail/upload_video',
    method: 'post',
    onUploadProgress: fn,
    data
  })
}
