import upload from '@/utils/upload'
import request from '@/utils/request'

// 新增课件
export function saveCase(data,isEdit) {
  return request({
    url: '/business/caseBaseInfo',
	method: isEdit ? 'put' : 'post',
    data: data
  })
}

// 查询用户课件列表
export function getUserCaseList(data) {
  return request({
    url: '/business/caseBaseInfo/appList',
    method: 'get',
	data
  })
}

// 获取课件详情
export function getCaseDetail(id) {
  return request({
    url: '/business/caseBaseInfo/'+id,
    method: 'get'
  })
}

// 文件上传
export function uploadFile(data) {
  return upload({
    url: '/resource/oss/upload',
	method: 'post',
    name: data.name,
    filePath: data.filePath,
  })
}

// 获取已绑定志愿者列表
export function volunteerSelectList() {
  return request({
    url: '/business/doctorVolunteer/volunteerSelectList',
    method: 'get'
  })
}

// 获取已绑定医生列表
export function doctorSelectList() {
  return request({
    url: '/business/doctorVolunteer/doctorSelectList',
    method: 'get'
  })
}

// 申请解读
export function applyAnalysis(data) {
  return request({
    url: '/business/caseBaseInfo/analysisAudit',
    method: 'put',
	data
  })
}

//
export function putBeautifyFileDownload(data){
  return request({
    url: '/business/caseBaseInfo/beautify/download',
    method: 'put',
    data
  })
}

// 获取doc/PPT/xls 文件的跳转路径
export function getDocUrl(ossId) {
  return request({
    url: '/resource/oss/previewDoc/' + ossId,
    method: 'get'
  })
}
