diff --git a/src/main/java/com/lk/paopao/mapper/PostMapper.java b/src/main/java/com/lk/paopao/mapper/PostMapper.java index ba3b29b..6146526 100644 --- a/src/main/java/com/lk/paopao/mapper/PostMapper.java +++ b/src/main/java/com/lk/paopao/mapper/PostMapper.java @@ -1,7 +1,9 @@ package com.lk.paopao.mapper; +import com.lk.paopao.dto.PostContentDto; import com.lk.paopao.entity.Post; import com.lk.paopao.dto.PostDto; +import com.lk.paopao.entity.PostContent; import org.mapstruct.*; @Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE, componentModel = MappingConstants.ComponentModel.SPRING) @@ -13,4 +15,7 @@ public interface PostMapper { @BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE) Post partialUpdate(PostDto postDto, @MappingTarget Post post); + + @Mapping(source = "post.id", target = "postId") + PostContentDto toContentDto(PostContent postContent); } \ No newline at end of file