Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public GetGroupV2Response getGroup(Long userId, Long groupId) {

List<GroupUserV2> users = isHost
? groupUserV2Repository.findByGroupIdOrderByJoinedAtAscWithUser(groupId)
: groupUserV2Repository.findAttendByGroupIdOrderByJoinedAtAscWithUser(groupId);
: groupUserV2Repository.findAttendPlusMeByGroupId(groupId, userId);

// 컬렉션은 안전하게 따로 보관해서 옮겨야 좋다고 한다.
List<GroupImageV2> images = groupImageV2Repository.findAllByGroupIdWithVariants(groupId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,15 @@ List<Long> findUserIdsByGroupIdAndStatuses(
""")
List<GroupUserV2> findAttendByGroupIdOrderByJoinedAtAscWithUser(@Param("groupId") Long groupId);

@Query("""
select gu
from GroupUserV2 gu
join fetch gu.user u
where gu.group.id = :groupId
and (gu.status = team.wego.wegobackend.group.v2.domain.entity.GroupUserV2Status.ATTEND
or u.id = :userId)
Comment on lines +92 to +93
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The query may return duplicate results if a user has ATTEND status AND matches the userId condition. Consider adding DISTINCT to the query or handling duplicates in the service layer.

Copilot uses AI. Check for mistakes.
order by gu.joinedAt asc
""")
List<GroupUserV2> findAttendPlusMeByGroupId(@Param("groupId") Long groupId,
@Param("userId") Long userId);
Comment on lines +96 to +97
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method name findAttendPlusMeByGroupId doesn't clearly indicate that it may return users with non-ATTEND status. Consider renaming to findAttendingUsersAndCurrentUser or findAttendingUsersIncludingUser for better clarity.

Suggested change
List<GroupUserV2> findAttendPlusMeByGroupId(@Param("groupId") Long groupId,
@Param("userId") Long userId);
List<GroupUserV2> findAttendingUsersAndCurrentUser(@Param("groupId") Long groupId,
@Param("userId") Long userId);
@Deprecated
default List<GroupUserV2> findAttendPlusMeByGroupId(@Param("groupId") Long groupId,
@Param("userId") Long userId) {
return findAttendingUsersAndCurrentUser(groupId, userId);
}

Copilot uses AI. Check for mistakes.
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ Authorization: Bearer {{member1AccessToken}}

{}

### 3. 승인제 - MEMBER 2 참여 (성공: PENDING)
POST http://localhost:8080/api/v2/groups/{{groupId_approvalTest}}/attend
Content-Type: application/json
Authorization: Bearer {{member2AccessToken}}

{}

### 3-1. 예외: 승인제 - MEMBER 1 중복 신청 (이미 PENDING)
POST http://localhost:8080/api/v2/groups/{{groupId_approvalTest}}/attend
Content-Type: application/json
Expand Down Expand Up @@ -182,7 +189,7 @@ Authorization: Bearer {{host2AccessToken}}

### 7. (선택) 모임 상세 조회 - MEMBER1 토큰으로 내 상태 확인
GET http://localhost:8080/api/v2/groups/{{groupId_approvalTest}}
Authorization: Bearer {{member1AccessToken}}
Authorization: Bearer {{host2AccessToken}}
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test description says 'MEMBER1 토큰으로 내 상태 확인' (check my status with MEMBER1 token) but uses host2AccessToken instead. Update the comment to match the actual token being used or revert to member1AccessToken if the comment is correct.

Suggested change
Authorization: Bearer {{host2AccessToken}}
Authorization: Bearer {{member1AccessToken}}

Copilot uses AI. Check for mistakes.

### 8. (선택) MEMBER1이 모임 left 시도 (HOST는 left 불가)
POST http://localhost:8080/api/v2/groups/{{groupId_approvalTest}}/left
Expand Down
Loading