package com.lesingle.edu.common.mapper;

import com.lesingle.edu.dto.response.ClassResponse;
import com.lesingle.edu.entity.Clazz;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * Clazz Entity Mapper
 */
@Mapper(componentModel = "spring")
public interface ClassMapper {

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

    /**
     * Entity 转 Response
     */
    ClassResponse toVO(Clazz entity);

    /**
     * Entity 列表转 Response 列表
     */
    List<ClassResponse> toVO(List<Clazz> entities);

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