package com.lesingle.edu.common.mapper;

import com.lesingle.edu.dto.response.CourseActivityResponse;
import com.lesingle.edu.entity.CourseActivity;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * CourseActivity Entity Mapper
 */
@Mapper(componentModel = "spring")
public interface CourseActivityMapper {

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

    /**
     * Entity 转 Response
     */
    CourseActivityResponse toVO(CourseActivity entity);

    /**
     * Entity 列表转 Response 列表
     */
    List<CourseActivityResponse> toVO(List<CourseActivity> entities);

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