Skip to content

Commit

Permalink
imp: 그룹 정보 조회 진행시, owner nickname을 같이 제공
Browse files Browse the repository at this point in the history
  • Loading branch information
DongGeon0908 committed Sep 14, 2024
1 parent 9a10e17 commit 9262c22
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ class GroupFacade(
.take(5)
}
) { group, joinedGroup, groupUserScore ->
GetGroupResponse.from(group).run {
val ownerGroupUser = userInfoService.getUserByIdOrThrow(group.ownerUid)

GetGroupResponse.from(group, ownerGroupUser.nickname).run {
when (group.ownerUid == user.uid) {
true -> this
false -> this.copy(joinCode = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ data class GetGroupResponse(
val name: String,
val description: String?,
val ownerUid: Long,
/** 그룹장명 */
val ownerName: String,
val isHidden: Boolean,
/** 그룹장만 조회 가능 */
val joinCode: String?,
Expand All @@ -17,12 +19,13 @@ data class GetGroupResponse(
val ranks: List<GetGroupRankResponse>? = null
) {
companion object {
fun from(group: Group): GetGroupResponse {
fun from(group: Group, ownerName: String): GetGroupResponse {
return GetGroupResponse(
id = group.id,
name = group.name,
description = group.description,
ownerUid = group.ownerUid,
ownerName = ownerName,
isHidden = group.isHidden,
joinCode = group.joinCode,
userCount = group.userCount,
Expand Down

0 comments on commit 9262c22

Please sign in to comment.