From e7c7fa02cc5b59498f3fc769e5795a419a9cc6f5 Mon Sep 17 00:00:00 2001 From: soohyeon Date: Mon, 2 Sep 2024 19:55:57 +0900 Subject: [PATCH] add :: checkAccountId api --- .../presentation/dto/request/UserCheckRequest.kt | 5 +++++ .../domain/user/service/CheckAccountIdService.kt | 14 ++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 src/main/kotlin/org/meogo/domain/user/presentation/dto/request/UserCheckRequest.kt create mode 100644 src/main/kotlin/org/meogo/domain/user/service/CheckAccountIdService.kt diff --git a/src/main/kotlin/org/meogo/domain/user/presentation/dto/request/UserCheckRequest.kt b/src/main/kotlin/org/meogo/domain/user/presentation/dto/request/UserCheckRequest.kt new file mode 100644 index 0000000..7cc0ba6 --- /dev/null +++ b/src/main/kotlin/org/meogo/domain/user/presentation/dto/request/UserCheckRequest.kt @@ -0,0 +1,5 @@ +package org.meogo.domain.user.presentation.dto.request + +data class UserCheckRequest( + val accountId: String +) diff --git a/src/main/kotlin/org/meogo/domain/user/service/CheckAccountIdService.kt b/src/main/kotlin/org/meogo/domain/user/service/CheckAccountIdService.kt new file mode 100644 index 0000000..b8afa47 --- /dev/null +++ b/src/main/kotlin/org/meogo/domain/user/service/CheckAccountIdService.kt @@ -0,0 +1,14 @@ +package org.meogo.domain.user.service + +import org.meogo.domain.user.presentation.dto.request.UserCheckRequest +import org.meogo.domain.user.repository.UserRepository +import org.springframework.stereotype.Service + +@Service +class CheckAccountIdService( + private val userRepository: UserRepository +) { + fun execute(request: UserCheckRequest): Boolean { + return userRepository.existsByAccountId(request.accountId) + } +}