From e0f547c44afcff348086f550d3474b65a294ca6b Mon Sep 17 00:00:00 2001 From: JuseungL <121665437+JuseungL@users.noreply.github.com> Date: Mon, 29 Jul 2024 00:53:54 +0900 Subject: [PATCH] =?UTF-8?q?[BUG]=20:=20=EB=AC=B8=EC=9D=98=EB=93=B1?= =?UTF-8?q?=EB=A1=9D=20=EC=84=9C=EB=B9=84=EC=8A=A4=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20-=20close=20#19?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/contact/service/ContactCommandService.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/lion6/DrinkGuide/api/contact/service/ContactCommandService.java b/src/main/java/lion6/DrinkGuide/api/contact/service/ContactCommandService.java index a7fb88e..91bdd30 100644 --- a/src/main/java/lion6/DrinkGuide/api/contact/service/ContactCommandService.java +++ b/src/main/java/lion6/DrinkGuide/api/contact/service/ContactCommandService.java @@ -1,6 +1,8 @@ package lion6.DrinkGuide.api.contact.service; +import lion6.DrinkGuide.api.contact.domain.Contact; import lion6.DrinkGuide.api.contact.repository.ContactRepository; +import lion6.DrinkGuide.api.member.repository.MemberRepository; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -9,9 +11,15 @@ @Transactional @RequiredArgsConstructor public class ContactCommandService { + private final MemberRepository memberRepository; private final ContactRepository contactRepository; public void createContact(Long memberId, String title, String content) { - + Contact contact = Contact.builder() + .title(title) + .content(content) + .member(memberRepository.findMemberByIdOrThrow(memberId)) + .build(); + contactRepository.save(contact); } }