From bacb030d3ae6dc7b92e31f4d5acdb549cf11f0b6 Mon Sep 17 00:00:00 2001 From: many2many <6168830@qq.com> Date: Fri, 31 May 2024 13:32:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=BD=AC=E6=8D=A2=E5=90=8E?= =?UTF-8?q?=EF=BC=8CpostContentDto.postId=E6=B2=A1=E6=9C=89=E8=B5=8B?= =?UTF-8?q?=E5=80=BC=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82=20=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AApostContentDto?= =?UTF-8?q?=E7=9A=84=E8=BD=AC=E6=8D=A2=E6=96=B9=E6=B3=95=EF=BC=8Cmapstruct?= =?UTF-8?q?=E5=B9=B6=E5=9B=9E=E5=8E=BB=E4=BD=BF=E7=94=A8=20PostContentMapp?= =?UTF-8?q?er=E4=B8=AD=E7=9A=84=E5=AE=9A=E4=B9=89=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/lk/paopao/mapper/PostMapper.java | 5 +++++ 1 file changed, 5 insertions(+) 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