-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat : FcmToken 포트 구현 * feat : FcmToken 저장 API * feat : FcmToken 저장 Transactional 누락 반영
- Loading branch information
1 parent
a90b018
commit b79a3e0
Showing
9 changed files
with
92 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
adapters/in-web/src/main/kotlin/com/pokit/user/dto/request/ApiCreateFcmTokenRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.pokit.user.dto.request | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema | ||
import jakarta.validation.constraints.NotNull | ||
|
||
data class ApiCreateFcmTokenRequest( | ||
@field:Schema(description = "사용자 기기 토큰(FCM 토큰)") | ||
@field:NotNull | ||
val token: String | ||
) | ||
|
||
internal fun ApiCreateFcmTokenRequest.toDto() = CreateFcmTokenRequest( | ||
token = this.token | ||
) |
18 changes: 18 additions & 0 deletions
18
...rs/out-persistence/src/main/kotlin/com/pokit/out/persistence/user/impl/FcmTokenAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.pokit.out.persistence.user.impl | ||
|
||
import com.pokit.out.persistence.user.persist.FcmTokenEntity | ||
import com.pokit.out.persistence.user.persist.FcmTokenRepository | ||
import com.pokit.out.persistence.user.persist.toDomain | ||
import com.pokit.user.model.FcmToken | ||
import com.pokit.user.port.out.FcmTokenPort | ||
import org.springframework.stereotype.Repository | ||
|
||
@Repository | ||
class FcmTokenAdapter( | ||
private val fcmTokenRepository: FcmTokenRepository | ||
) : FcmTokenPort { | ||
override fun persist(fcmToken: FcmToken): FcmToken { | ||
val fcmTokenEntity = FcmTokenEntity.of(fcmToken) | ||
return fcmTokenRepository.save(fcmTokenEntity).toDomain() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...-persistence/src/main/kotlin/com/pokit/out/persistence/user/persist/FcmTokenRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.pokit.out.persistence.user.persist | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository | ||
|
||
interface FcmTokenRepository : JpaRepository<FcmTokenEntity, Long> { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
application/src/main/kotlin/com/pokit/user/port/out/FcmTokenPort.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.pokit.user.port.out | ||
|
||
import com.pokit.user.model.FcmToken | ||
|
||
interface FcmTokenPort { | ||
fun persist(fcmToken: FcmToken): FcmToken | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
domain/src/main/kotlin/com/pokit/user/dto/request/CreateFcmTokenRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.pokit.user.dto.request | ||
|
||
data class CreateFcmTokenRequest( | ||
val token: String | ||
) |