package com.lesingle.edu.common.mapper;

import com.lesingle.edu.dto.response.CourseVersionResponse;
import com.lesingle.edu.entity.CourseVersion;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * CourseVersion Entity Mapper
 */
@Mapper(componentModel = "spring")
public interface CourseVersionMapper {

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

    /**
     * Entity 转 Response
     */
    CourseVersionResponse toVO(CourseVersion entity);

    /**
     * Entity 列表转 Response 列表
     */
    List<CourseVersionResponse> toVO(List<CourseVersion> entities);

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