package com.seer.teach.mall.convert;

import com.seer.teach.mall.entity.GoodsCommentEntity;
import com.seer.teach.mall.request.GoodsCommentCreateReq;
import com.seer.teach.mall.response.GoodsCommentResp;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface GoodsCommentConvert {

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

    GoodsCommentEntity convertOne(GoodsCommentCreateReq req);

    @Mapping( target = "attributes",ignore= true)
    GoodsCommentResp convertOne(GoodsCommentEntity entity);

    List<GoodsCommentResp> convertList(List<GoodsCommentEntity> entityList);

}
