@@ -88,10 +88,9 @@ private String calculateRecentUpdate(Team group) {
88
88
// 그룹 프로필 조회
89
89
public BaseResponse <GroupProfileResponse > getGroupProfile (Long groupIdx ) {
90
90
Team group = groupRepository .findById (groupIdx ).orElseThrow (() -> new BaseException (INVALID_GROUP_IDX ));
91
- List <String > memberImageList = group .getUserTeams ().stream ()
92
- .map (userTeam -> userTeam .getUser ().getProfile ().getProfileImage ())
93
- .limit (3 )
94
- .toList ();
91
+ // List<String> memberImageList = group.getUserTeams().stream()
92
+ // .map(userTeam -> userTeam.getUser().getProfile().getProfileImage())
93
+ // .limit(3).toList();
95
94
96
95
Integer puzzleCount = puzzleRepository .countByTeam (group );
97
96
@@ -101,11 +100,23 @@ public BaseResponse<GroupProfileResponse> getGroupProfile(Long groupIdx) {
101
100
102
101
long dayCount = ChronoUnit .DAYS .between (startLocalDate , today );
103
102
104
- GroupProfileResponse profile = new GroupProfileResponse (group .getName (), group .getAdmin ().getProfile ().getNickname (), group .getStartDate ().getYear (), memberImageList ,
103
+ GroupProfileResponse profile = new GroupProfileResponse (group .getName (), group .getAdmin ().getProfile ().getNickname (), group .getStartDate ().getYear (), getMemberImageList ( group ) ,
105
104
group .getUserTeams ().size (), puzzleCount , dayCount );
106
105
return new BaseResponse <>(profile );
107
106
}
108
107
108
+ private List <String > getMemberImageList (Team group ) {
109
+ List <String > imageList = new ArrayList <>();
110
+ imageList .add (group .getAdmin ().getProfile ().getProfileImage ());
111
+
112
+ List <String > memberImages = group .getUserTeams ().stream ()
113
+ .filter (userTeam -> "active" .equals (userTeam .getStatus ()))
114
+ .map (userTeam -> userTeam .getUser ().getProfile ().getProfileImage ())
115
+ .limit (2 ).toList ();
116
+ imageList .addAll (memberImages );
117
+ return imageList ;
118
+ }
119
+
109
120
110
121
// [관리자] 그룹 수정 화면 조회
111
122
public BaseResponse <GroupEditViewResponse > getGroupEditView (Long groupIdx ) {
@@ -188,8 +199,8 @@ public BaseResponse<String> withdrawGroup(Long groupIdx) {
188
199
189
200
UserTeam userTeam = validateMember (user , group );
190
201
userTeam .delete ();
191
- userTeam .removeTeam (group );
192
- userTeam .removeUser (user );
202
+ // userTeam.removeTeam(group);
203
+ // userTeam.removeUser(user);
193
204
userTeamRepository .save (userTeam );
194
205
195
206
return new BaseResponse <>(SUCCESS );
0 commit comments