Skip to content

Commit

Permalink
feat : 회원가입 시 Interest 저장 로직 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
dlswns2480 committed Nov 28, 2024
1 parent 32ff728 commit c905deb
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -58,6 +61,12 @@ class UserService(
)
categoryPort.persist(category)

request.interests.forEach {
interestPort.persist(
Interest(userId = user.id, interestType = it)
)
}

return savedUser
}

Expand Down

0 comments on commit c905deb

Please sign in to comment.