Skip to content

Commit

Permalink
Merge pull request #186 from depromeet/feature/#171
Browse files Browse the repository at this point in the history
feat(#171): 피드에 누락된 필드 추가
  • Loading branch information
ManHyuk authored Feb 24, 2024
2 parents 059d83c + 49a7205 commit 57e9347
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package io.raemian.api.goal.domain

import io.raemian.storage.db.core.model.GoalExploreQueryResult
import java.time.LocalDate
import java.time.LocalDateTime

data class GoalSubset(
val id: Long,
Expand All @@ -10,6 +11,7 @@ data class GoalSubset(
val deadline: LocalDate,
val sticker: String,
val tag: String,
val createdAt: LocalDateTime,
) {
constructor(result: GoalExploreQueryResult) : this(
id = result.goalId,
Expand All @@ -18,5 +20,6 @@ data class GoalSubset(
deadline = result.deadline,
sticker = result.stickerUrl,
tag = result.tagContent,
createdAt = result.createdAt,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ data class LifeMapDTO(
user = UserSubset(
id = user.id ?: 0,
nickname = user.nickname!!,
username = user.username ?: "",
image = user.image,
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@ import io.raemian.storage.db.core.user.User
data class UserSubset(
val id: Long,
val nickname: String,
val username: String,
val image: String,
) {
constructor(user: User) : this(
id = user.id!!,
nickname = user.nickname ?: "",
username = user.username ?: "",
image = user.image,
)

constructor(result: GoalExploreQueryResult) : this(
id = result.userId,
nickname = result.nickname,
username = result.username,
image = result.userImage,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ interface GoalRepository : JpaRepository<Goal, Long> {
count.viewCount,
user.id,
user.nickname,
user.username,
user.image
)
FROM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ data class GoalExploreQueryResult(
val viewCount: Long,
val userId: Long,
val nickname: String,
val username: String,
val userImage: String,
)

0 comments on commit 57e9347

Please sign in to comment.