import { useStore } from './../store/index';
import axiosInstance from "./axios.config";

const MEDIA_PREFIX = "/api/media"

const mediaApis = {

    getAudioScore:(userId: Number, assignmentId: Number, index: Number)=>{
        return axiosInstance.get(`${MEDIA_PREFIX}/audioScore`, {
            params: {
                userId,
                assignmentId,
                index
            },
            timeout: 30000 // 音频分析需要较长时间
        })
    },
    getAudioSentiment:(userId: Number, assignmentId: Number, index: Number)=>{
        return axiosInstance.get(`${MEDIA_PREFIX}/audioSentiment`, {
            params: {
                userId,
                assignmentId,
                index
            },
            timeout: 30000 // 情感分析需要较长时间
        })
    },
    getSpeakingSuggestion:(userId: Number, assignmentId: Number) => {
        return axiosInstance.get(`${MEDIA_PREFIX}/speakingSuggestion`, {
            params: {
                userId,
                assignmentId
            }
        })
    },
    getVideoSentiment:(userId: Number, assignmentId: Number) => {
        return axiosInstance.get(`${MEDIA_PREFIX}/videoSentiment`, {
            params: {
                userId,
                assignmentId
            }
        })
    }

   
}

export default mediaApis