package com.lesingle.edu.common.mapper;

import com.lesingle.edu.dto.response.StudentResponse;
import com.lesingle.edu.entity.Student;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * Student Entity Mapper
 */
@Mapper(componentModel = "spring")
public interface StudentMapper {

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

    /**
     * Entity 转 Response
     */
    StudentResponse toVO(Student entity);

    /**
     * Entity 列表转 Response 列表
     */
    List<StudentResponse> toVO(List<Student> entities);

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