package com.lesingle.edu.common.mapper;

import com.lesingle.edu.dto.response.TaskResponse;
import com.lesingle.edu.entity.Task;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * Task Entity Mapper
 */
@Mapper(componentModel = "spring")
public interface TaskMapper {

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

    /**
     * Entity 转 Response
     */
    TaskResponse toVO(Task entity);

    /**
     * Entity 列表转 Response 列表
     */
    List<TaskResponse> toVO(List<Task> entities);

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