From aa59ba72aef3325a01cc5ca0e6bc34c9d5802358 Mon Sep 17 00:00:00 2001 From: kimjm9841 Date: Wed, 14 Feb 2024 00:10:13 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EC=97=B0=EA=B4=80=EA=B4=80?= =?UTF-8?q?=EA=B3=84=20=EC=84=A4=EC=A0=95=20=EB=B0=A9=EC=8B=9D=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../onnoff/onnoff/domain/off/memoir/entity/MemoirAnswer.java | 5 ----- .../onnoff/domain/off/memoir/service/MemoirServiceImpl.java | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/onnoff/onnoff/domain/off/memoir/entity/MemoirAnswer.java b/src/main/java/com/onnoff/onnoff/domain/off/memoir/entity/MemoirAnswer.java index 13e21b3..6fc56a0 100644 --- a/src/main/java/com/onnoff/onnoff/domain/off/memoir/entity/MemoirAnswer.java +++ b/src/main/java/com/onnoff/onnoff/domain/off/memoir/entity/MemoirAnswer.java @@ -29,9 +29,4 @@ public class MemoirAnswer extends BaseEntity { public void setAnswer(String answer) { this.answer = answer; } - - public void setMemoir(Memoir memoir) { - this.memoir = memoir; - memoir.getMemoirAnswerList().add(this); - } } diff --git a/src/main/java/com/onnoff/onnoff/domain/off/memoir/service/MemoirServiceImpl.java b/src/main/java/com/onnoff/onnoff/domain/off/memoir/service/MemoirServiceImpl.java index c4dfb4c..06c6054 100644 --- a/src/main/java/com/onnoff/onnoff/domain/off/memoir/service/MemoirServiceImpl.java +++ b/src/main/java/com/onnoff/onnoff/domain/off/memoir/service/MemoirServiceImpl.java @@ -61,10 +61,11 @@ public Memoir writeMemoir(MemoirRequestDTO.MemoirWriteDTO request) { MemoirAnswer newMemoirAnswer = MemoirAnswer.builder() .answer(memoirAnswer.getAnswer().trim()) + .memoir(newMemoir) .memoirQuestion(memoirQuestion) .build(); - newMemoirAnswer.setMemoir(newMemoir); + newMemoir.getMemoirAnswerList().add(newMemoirAnswer); memoirAnswerRepository.save(newMemoirAnswer); }