// src/api/studySession.ts
import request from "@/utils/request";

export const continueSession = (sessionNum: string) => {
    return request.post(`/study-sessions/${sessionNum}/study-sessions/continue`);
};

export const pauseSession = (sessionNum: string, endTime?: Date) => {
    const params = endTime ? { endTime: endTime.toISOString() } : null;
    return request.post(`/study-sessions/${sessionNum}/study-sessions/pause`, null, { params });
};

export const endSession = (sessionNum: string, content: string = "任务结束") => {
    return request.post(`/study-sessions/${sessionNum}/study-sessions/ended`, { content });
};

export const startOrContinueStudySession = (taskNum: string) => {
    return request.get(`/tasks/${taskNum}/study-sessions/start-or-continue`);
};
