package com.lesingle.edu.common.mapper;

import com.lesingle.edu.dto.response.CourseScriptResponse;
import com.lesingle.edu.entity.CourseScript;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * CourseScript Entity Mapper
 */
@Mapper(componentModel = "spring")
public interface CourseScriptMapper {

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

    /**
     * Entity 转 Response
     */
    CourseScriptResponse toVO(CourseScript entity);

    /**
     * Entity 列表转 Response 列表
     */
    List<CourseScriptResponse> toVO(List<CourseScript> entities);

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