From c905debb1848a4953f4f28d6cb8968fee7481b59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=9D=B8=EC=A4=80?= Date: Thu, 28 Nov 2024 14:40:43 +0900 Subject: [PATCH] =?UTF-8?q?feat=20:=20=ED=9A=8C=EC=9B=90=EA=B0=80=EC=9E=85?= =?UTF-8?q?=20=EC=8B=9C=20Interest=20=EC=A0=80=EC=9E=A5=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kotlin/com/pokit/user/port/service/UserService.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/application/src/main/kotlin/com/pokit/user/port/service/UserService.kt b/application/src/main/kotlin/com/pokit/user/port/service/UserService.kt index d897f883..939e52b8 100644 --- a/application/src/main/kotlin/com/pokit/user/port/service/UserService.kt +++ b/application/src/main/kotlin/com/pokit/user/port/service/UserService.kt @@ -14,9 +14,11 @@ import com.pokit.user.dto.request.UpdateNicknameRequest import com.pokit.user.dto.request.UserCommand import com.pokit.user.exception.UserErrorCode import com.pokit.user.model.FcmToken +import com.pokit.user.model.Interest import com.pokit.user.model.User import com.pokit.user.port.`in`.UserUseCase import com.pokit.user.port.out.FcmTokenPort +import com.pokit.user.port.out.InterestPort import com.pokit.user.port.out.UserImagePort import com.pokit.user.port.out.UserPort import org.springframework.stereotype.Service @@ -29,7 +31,8 @@ class UserService( private val categoryPort: CategoryPort, private val categoryImagePort: CategoryImagePort, private val fcmTokenPort: FcmTokenPort, - private val userImagePort: UserImagePort + private val userImagePort: UserImagePort, + private val interestPort: InterestPort, ) : UserUseCase { companion object { private const val UNCATEGORIZED_IMAGE_ID = 1 @@ -58,6 +61,12 @@ class UserService( ) categoryPort.persist(category) + request.interests.forEach { + interestPort.persist( + Interest(userId = user.id, interestType = it) + ) + } + return savedUser }