package com.lesingle.edu.common.mapper;

import com.lesingle.edu.dto.response.ResourceLibraryResponse;
import com.lesingle.edu.entity.ResourceLibrary;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * ResourceLibrary Entity Mapper
 */
@Mapper(componentModel = "spring")
public interface ResourceLibraryMapper {

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

    /**
     * Entity 转 Response
     */
    ResourceLibraryResponse toVO(ResourceLibrary entity);

    /**
     * Entity 列表转 Response 列表
     */
    List<ResourceLibraryResponse> toVO(List<ResourceLibrary> entities);

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