Skip to content

Commit

Permalink
add: (#25) User Mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
khcho0125 committed Sep 4, 2022
1 parent dd87566 commit d2dc96c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
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
}
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> {
}

0 comments on commit d2dc96c

Please sign in to comment.