package com.lesingle.edu.common.mapper;

import com.lesingle.edu.dto.response.CourseLessonResponse;
import com.lesingle.edu.entity.CourseLesson;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * CourseLesson Entity Mapper
 */
@Mapper(componentModel = "spring")
public interface CourseLessonMapper {

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

    /**
     * Entity 转 Response
     */
    CourseLessonResponse toVO(CourseLesson entity);

    /**
     * Entity 列表转 Response 列表
     */
    List<CourseLessonResponse> toVO(List<CourseLesson> entities);

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