import request from '@/utils/request'

// 查询运动处方库数据列表
export function listMotionPrescriptionLibrary(query) {
    return request({
        url: '/system/motionPrescriptionLibrary/list',
        method: 'get',
        params: query
    })
}

// 查询运动处方库数据详细
export function getMotionPrescriptionLibrary(id) {
    return request({
        url: '/system/motionPrescriptionLibrary/' + id,
        method: 'get'
    })
}

// 新增运动处方库数据
export function addMotionPrescriptionLibrary(data) {
    return request({
        url: '/system/motionPrescriptionLibrary/add',
        method: 'post',
        data: data
    })
}

// 修改运动处方库数据
export function updateMotionPrescriptionLibrary(data) {
    return request({
        url: '/system/motionPrescriptionLibrary/edit',
        method: 'post',
        data: data
    })
}

// 删除运动处方库数据
export function delMotionPrescriptionLibrary(id) {
    return request({
        url: '/system/motionPrescriptionLibrary/' + id,
        method: 'delete'
    })
}

//点击视频上传
export function getPrescriptionVideoInfo(id) {
    return request({
        url: `/system/motionPrescriptionLibrary/getPrescriptionVideoInfo?motionPrescriptionId=${id}`,
        method: 'get',
    })
}



//上传视频
export function confirmUploadVideo(data) {
    return request({
        url: `/system/motionPrescriptionLibrary/confirmUploadVideo`,
        method: 'post',
        data
    })
}


//删除图
export function deletePrescriptionVideo(prescriptionVideoUrl) {
    return request({
        url: `/system/motionPrescriptionLibrary/deletePrescriptionVideo?prescriptionVideoUrl=${prescriptionVideoUrl}`,
        method: 'post',
    })
}


//获得图列表
export function prescriptionVideoUpload(id) {
    return request({
        url: `/system/motionPrescriptionLibrary/prescriptionVideoUpload?id=${id}`,
        method: 'get',
    })
}