Skip to content

Commit

Permalink
Merge pull request #176 from depromeet/feature/#171
Browse files Browse the repository at this point in the history
feat(#171): 유저 정보 추가
  • Loading branch information
ManHyuk authored Feb 11, 2024
2 parents 4f3a25a + 6d01646 commit 5070cf1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ data class LifeMapDTO(
isPublic = lifeMap.isPublic,
goals = lifeMap.goals.map(::GoalDto),
goalsCount = lifeMap.goals.size,
user = UserSubset(lifeMap.user),
)

constructor(lifeMap: LifeMap, user: User) : this(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
package io.raemian.api.user.domain

import io.raemian.storage.db.core.user.User

data class UserSubset(
val id: Long,
val nickname: String,
val image: String,
)
) {
constructor(user: User) : this(
id = user.id!!,
nickname = user.nickname ?: "",
image = user.image,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import jakarta.persistence.Table
@Table(name = "LIFE_MAPS")
class LifeMap(
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id", nullable = false)
@JoinColumn(name = "user_id")
val user: User,

@Column(nullable = false)
Expand Down

0 comments on commit 5070cf1

Please sign in to comment.