package com.lesingle.edu.common.mapper;

import com.lesingle.edu.dto.response.TagResponse;
import com.lesingle.edu.entity.Tag;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * Tag Entity Mapper
 */
@Mapper(componentModel = "spring")
public interface TagMapper {

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

    /**
     * Entity 转 Response
     */
    TagResponse toVO(Tag entity);

    /**
     * Entity 列表转 Response 列表
     */
    List<TagResponse> toVO(List<Tag> entities);

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