package com.lesingle.edu.common.mapper;

import com.lesingle.edu.dto.response.CourseResourceResponse;
import com.lesingle.edu.entity.CourseResource;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * CourseResource Entity Mapper
 */
@Mapper(componentModel = "spring")
public interface CourseResourceMapper {

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

    /**
     * Entity 转 Response
     */
    CourseResourceResponse toVO(CourseResource entity);

    /**
     * Entity 列表转 Response 列表
     */
    List<CourseResourceResponse> toVO(List<CourseResource> entities);

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