-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
66 additions
and
4 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
32 changes: 32 additions & 0 deletions
32
...ructure/src/main/kotlin/team/comit/simtong/persistence/auth/AuthCodePersistenceAdapter.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,32 @@ | ||
package team.comit.simtong.persistence.auth | ||
|
||
import org.springframework.stereotype.Component | ||
import team.comit.simtong.domain.auth.model.AuthCode | ||
import team.comit.simtong.domain.auth.spi.AuthCodePort | ||
import team.comit.simtong.persistence.auth.mapper.AuthCodeMapper | ||
import team.comit.simtong.persistence.auth.repository.AuthCodeRepository | ||
|
||
/** | ||
* | ||
* AuthCode를 관리하는 AuthCodePersistenceAdapter | ||
* | ||
* @author Chokyunghyeon | ||
* @date 2022/09/25 | ||
* @version 1.0.0 | ||
**/ | ||
@Component | ||
class AuthCodePersistenceAdapter( | ||
private val authCodeMapper: AuthCodeMapper, | ||
private val authCodeRepository: AuthCodeRepository | ||
): AuthCodePort { | ||
|
||
override fun existsAuthCodeByEmailAndCode(email: String, code: String) = | ||
authCodeRepository.existsAuthCodeEntityByKeyAndCode(email, code) | ||
|
||
override fun save(authCode: AuthCode) = authCodeMapper.toDomain( | ||
authCodeRepository.save( | ||
authCodeMapper.toEntity(authCode) | ||
) | ||
)!! | ||
|
||
} |
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
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
18 changes: 18 additions & 0 deletions
18
...frastructure/src/main/kotlin/team/comit/simtong/persistence/auth/mapper/AuthCodeMapper.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 team.comit.simtong.persistence.auth.mapper | ||
|
||
import org.mapstruct.Mapper | ||
import team.comit.simtong.domain.auth.model.AuthCode | ||
import team.comit.simtong.persistence.GenericMapper | ||
import team.comit.simtong.persistence.auth.entity.AuthCodeEntity | ||
|
||
/** | ||
* | ||
* AuthCodeEntity와 DomainAuthCode를 변환하는 AuthCodeMapper | ||
* | ||
* @author Chokyunghyeon | ||
* @date 2022/09/25 | ||
* @version 1.0.0 | ||
**/ | ||
@Mapper | ||
abstract class AuthCodeMapper : GenericMapper<AuthCodeEntity, AuthCode> { | ||
} |
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