package com.lesingle.edu.common.mapper;

import com.lesingle.edu.dto.response.LessonResponse;
import com.lesingle.edu.entity.Lesson;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * Lesson Entity Mapper
 */
@Mapper(componentModel = "spring")
public interface LessonMapper {

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

    /**
     * Entity 转 Response
     */
    LessonResponse toVO(Lesson entity);

    /**
     * Entity 列表转 Response 列表
     */
    List<LessonResponse> toVO(List<Lesson> entities);

    /**
     * Response 转 Entity（用于创建/更新时）
     */
    Lesson toEntity(LessonResponse vo);
}
