Skip to content

Commit

Permalink
UserDto에 id추가
Browse files Browse the repository at this point in the history
  • Loading branch information
gidskql6671 committed May 30, 2024
1 parent d56f58d commit d513a25
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ data class UserDto(
val name: String,

@Schema(description = "github profile url", nullable = false, example = "https://avatars.githubusercontent.com/u/23000498?v=4")
val profileUrl: String
val profileUrl: String,

@Schema(description = "User ID", nullable = false, example = "1")
val id: Long? = null
)

fun UserDto.toEntity() = User(loginId, name, profileUrl)
fun User.toUserDto() = UserDto(loginId, name, profileUrl)
fun UserDto.toEntity() = User(loginId = loginId, name = name, profileUrl = profileUrl)
fun User.toUserDto() = UserDto(loginId = loginId, name = name, profileUrl = profileUrl, id = id)

0 comments on commit d513a25

Please sign in to comment.