package com.seer.teach.teacher.convert;


import com.seer.teach.common.dto.mq.LlmChatDTO;
import com.seer.teach.teacher.common.dto.TeachAudios;
import com.seer.teach.teacher.module.entity.*;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.time.LocalDateTime;

/**
 * @Author: Captain
 * @Description:
 * @Date: 2025-06-24 17:28
 */
@Mapper
public interface LessonConvert {

    LessonConvert INSTANCE = Mappers.getMapper(LessonConvert.class);

    LessonsEntity startLesson(Integer userId, Integer knowId, Integer subjectId, Integer gradeId, Integer status, LocalDateTime studyStartTime);

    LessonRecordsEntity toLessonRecord(Integer lessonId, Integer goalId, Integer textId, LocalDateTime startTime);

    @Mapping(source = "sessionId", target = "id")
    @Mapping(source = "audio.sort", target = "sort")
    @Mapping(source = "audio.data", target = "audioData")
    @Mapping(source = "mqTime", target = "mqTime")
    @Mapping(target = "text", ignore = true)
    @Mapping(target = "isFinal", ignore = true)
    LlmChatDTO toLlmChatDTO(Integer sessionId, TeachAudios audio, long mqTime);
}
