diff --git a/notification-domain/src/main/kotlin/io/github/v1servicenotification/detail/spi/PostDetailUserSpi.kt b/notification-domain/src/main/kotlin/io/github/v1servicenotification/detail/spi/PostDetailUserSpi.kt index bd4b4ea..ba9dd87 100644 --- a/notification-domain/src/main/kotlin/io/github/v1servicenotification/detail/spi/PostDetailUserSpi.kt +++ b/notification-domain/src/main/kotlin/io/github/v1servicenotification/detail/spi/PostDetailUserSpi.kt @@ -3,7 +3,7 @@ package io.github.v1servicenotification.detail.spi import java.util.UUID interface PostDetailUserSpi { - fun getExcludeUserIdList(userIdList: List?): List + fun getExcludeUserIdList(userIdList: List): List fun getDeviceToken(userId: UUID): String fun getDeviceTokenList(userIdList: List): List } diff --git a/notification-domain/src/main/kotlin/io/github/v1servicenotification/stubs/InMemoryUser.kt b/notification-domain/src/main/kotlin/io/github/v1servicenotification/stubs/InMemoryUser.kt index 7194b50..944cb54 100644 --- a/notification-domain/src/main/kotlin/io/github/v1servicenotification/stubs/InMemoryUser.kt +++ b/notification-domain/src/main/kotlin/io/github/v1servicenotification/stubs/InMemoryUser.kt @@ -11,7 +11,7 @@ class InMemoryUser: PostDetailUserSpi { this.userId = userId } - override fun getExcludeUserIdList(userIdList: List?): List { + override fun getExcludeUserIdList(userIdList: List): List { return listOf(userId) } diff --git a/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/user/domain/repository/CustomPostDetailUserImpl.kt b/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/user/domain/repository/CustomPostDetailUserImpl.kt index 16e06e5..36db87f 100644 --- a/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/user/domain/repository/CustomPostDetailUserImpl.kt +++ b/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/user/domain/repository/CustomPostDetailUserImpl.kt @@ -2,7 +2,7 @@ package io.github.v1servicenotification.domain.user.domain.repository import io.github.v1servicenotification.detail.spi.PostDetailUserSpi import io.github.v1servicenotification.infrastructure.feign.client.UserClient -import io.github.v1servicenotification.infrastructure.feign.client.dto.request.ExcludeUserIdsRequest +import io.github.v1servicenotification.infrastructure.feign.client.dto.request.GetExcludeUserIdsRequest import io.github.v1servicenotification.infrastructure.feign.error.FeignBadRequestException import org.springframework.stereotype.Component import java.util.UUID @@ -11,8 +11,8 @@ import java.util.UUID class CustomPostDetailUserImpl( private val userClient: UserClient ) : PostDetailUserSpi { - override fun getExcludeUserIdList(userIdList: List?): List { - val userIdsRequest = ExcludeUserIdsRequest(userIdList) + override fun getExcludeUserIdList(userIdList: List): List { + val userIdsRequest = GetExcludeUserIdsRequest(userIdList) return userClient.getExcludeUserIdList(userIdsRequest).userIdList } diff --git a/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/infrastructure/feign/client/UserClient.kt b/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/infrastructure/feign/client/UserClient.kt index aebe76a..69d83ef 100644 --- a/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/infrastructure/feign/client/UserClient.kt +++ b/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/infrastructure/feign/client/UserClient.kt @@ -1,6 +1,6 @@ package io.github.v1servicenotification.infrastructure.feign.client -import io.github.v1servicenotification.infrastructure.feign.client.dto.request.ExcludeUserIdsRequest +import io.github.v1servicenotification.infrastructure.feign.client.dto.request.GetExcludeUserIdsRequest import io.github.v1servicenotification.infrastructure.feign.client.dto.response.TokenResponse import io.github.v1servicenotification.infrastructure.feign.client.dto.response.UserIdListResponse import org.springframework.cloud.openfeign.FeignClient @@ -16,5 +16,5 @@ interface UserClient { fun token(@RequestParam("users") userList: List): TokenResponse @GetMapping("/users/exclude") - fun getExcludeUserIdList(@RequestBody request: ExcludeUserIdsRequest): UserIdListResponse + fun getExcludeUserIdList(@RequestBody request: GetExcludeUserIdsRequest): UserIdListResponse } diff --git a/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/infrastructure/feign/client/dto/request/ExcludeUserIdsRequest.kt b/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/infrastructure/feign/client/dto/request/ExcludeUserIdsRequest.kt deleted file mode 100644 index b8d5b85..0000000 --- a/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/infrastructure/feign/client/dto/request/ExcludeUserIdsRequest.kt +++ /dev/null @@ -1,9 +0,0 @@ -package io.github.v1servicenotification.infrastructure.feign.client.dto.request - -import java.util.UUID -import javax.annotation.Nullable - -data class ExcludeUserIdsRequest( - @field:Nullable - val userIds: List?, -) diff --git a/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/infrastructure/feign/client/dto/request/GetExcludeUserIdsRequest.kt b/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/infrastructure/feign/client/dto/request/GetExcludeUserIdsRequest.kt new file mode 100644 index 0000000..4b7f6ae --- /dev/null +++ b/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/infrastructure/feign/client/dto/request/GetExcludeUserIdsRequest.kt @@ -0,0 +1,7 @@ +package io.github.v1servicenotification.infrastructure.feign.client.dto.request + +import java.util.UUID + +data class GetExcludeUserIdsRequest( + val userIdList: List, +)