-
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
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
simtong-infrastructure/src/main/kotlin/team/comit/simtong/persistence/GenericMapper.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,16 @@ | ||
package team.comit.simtong.persistence | ||
|
||
/** | ||
* | ||
* Mapper의 기본 템플릿을 지원하는 GenericMapper | ||
* | ||
* @author Chokyunghyeon | ||
* @date 2022/09/04 | ||
* @version 1.0.0 | ||
**/ | ||
interface GenericMapper<E, D> { | ||
|
||
fun toEntity(model: D): E | ||
|
||
fun toDomain(entity: E): D | ||
} |
18 changes: 18 additions & 0 deletions
18
...g-infrastructure/src/main/kotlin/team/comit/simtong/persistence/user/mapper/UserMapper.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.user.mapper | ||
|
||
import org.mapstruct.Mapper | ||
import team.comit.simtong.domain.user.model.User | ||
import team.comit.simtong.persistence.GenericMapper | ||
import team.comit.simtong.persistence.user.entity.UserJpaEntity | ||
|
||
/** | ||
* | ||
* UserEntity와 DomainUser의 변환을 담당하는 UserMapper | ||
* | ||
* @author JoKyungHyeon | ||
* @date 2022/09/04 | ||
* @version 1.0.0 | ||
**/ | ||
@Mapper | ||
abstract class UserMapper: GenericMapper<UserJpaEntity, User> { | ||
} |