From e9de06852103335032d8bc722b74af3f4a793e45 Mon Sep 17 00:00:00 2001 From: rlacksgus97 Date: Mon, 18 Mar 2024 22:05:01 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=82=B4=EA=B0=80=20=EB=B0=9B=EC=9D=80?= =?UTF-8?q?=20=EC=84=A4=EB=AC=B8=EC=97=90=20=EC=9E=91=EC=84=B1=EC=9E=90=20?= =?UTF-8?q?wikiId=20=ED=8F=AC=ED=95=A8(#126)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/survey/model/dto/ReceivedSurveyDto.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/dnd/namuiwiki/domain/survey/model/dto/ReceivedSurveyDto.java b/src/main/java/com/dnd/namuiwiki/domain/survey/model/dto/ReceivedSurveyDto.java index b1b62573..48cb63fe 100644 --- a/src/main/java/com/dnd/namuiwiki/domain/survey/model/dto/ReceivedSurveyDto.java +++ b/src/main/java/com/dnd/namuiwiki/domain/survey/model/dto/ReceivedSurveyDto.java @@ -3,9 +3,12 @@ import com.dnd.namuiwiki.domain.survey.model.entity.Survey; import com.dnd.namuiwiki.domain.survey.type.Period; import com.dnd.namuiwiki.domain.survey.type.Relation; +import com.dnd.namuiwiki.domain.user.entity.User; import lombok.AllArgsConstructor; import lombok.Getter; +import java.util.Optional; + @Getter @AllArgsConstructor public class ReceivedSurveyDto { @@ -14,13 +17,21 @@ public class ReceivedSurveyDto { private Relation relation; private Period period; private String senderName; + private String senderWikiId; public static ReceivedSurveyDto from(Survey survey) { + String senderWikiId = null; + User sender = survey.getSender(); + if (sender != null) { + senderWikiId = sender.getWikiId(); + } + return new ReceivedSurveyDto( survey.getId(), survey.getRelation(), survey.getPeriod(), - survey.getSenderName() + survey.getSenderName(), + senderWikiId ); }