File tree Expand file tree Collapse file tree 2 files changed +4
-13
lines changed
src/main/java/ita/tinybite/domain/user Expand file tree Collapse file tree 2 files changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -158,19 +158,6 @@ public ResponseEntity<List<PartyCardResponse>> getParticipatingParties(
158158 return ResponseEntity .ok (response );
159159 }
160160
161- // @Operation(summary = "활성 파티 목록 조회", description = "사용자가 참여 중인 활성 파티 목록을 조회합니다.")
162- // @ApiResponses({
163- // @ApiResponse(responseCode = "200", description = "조회 성공",
164- // content = @Content(array = @ArraySchema(schema = @Schema(implementation = PartyCardResponse.class)))),
165- // @ApiResponse(responseCode = "401", description = "인증 실패")
166- // })
167- // @GetMapping("/parties/active")
168- // public ResponseEntity<List<PartyCardResponse>> getActiveParties(
169- // @AuthenticationPrincipal Long userId) {
170- // List<PartyCardResponse> response = userService.getActiveParties(userId);
171- // return ResponseEntity.ok(response);
172- // }
173-
174161 @ Operation (summary = "닉네임 중복 확인" , description = "닉네임 사용 가능 여부를 확인합니다." )
175162 @ ApiResponses ({
176163 @ ApiResponse (responseCode = "200" , description = "사용 가능한 닉네임" ),
Original file line number Diff line number Diff line change 2626
2727import java .time .LocalDateTime ;
2828import java .util .Arrays ;
29+ import java .util .Comparator ;
2930import java .util .List ;
3031import java .util .Optional ;
3132import java .util .stream .Collectors ;
@@ -181,6 +182,7 @@ public List<PartyCardResponse> getHostingParties(Long userId) {
181182 );
182183
183184 return parties .stream ()
185+ .sorted (Comparator .comparing (Party ::getCreatedAt ).reversed ())
184186 .map (party -> {
185187 int currentParticipants = participantRepository
186188 .countByPartyIdAndStatus (party .getId (), ParticipantStatus .APPROVED );
@@ -198,6 +200,8 @@ public List<PartyCardResponse> getParticipatingParties(Long userId) {
198200 );
199201
200202 return participants .stream ()
203+ .sorted (Comparator .comparing (pp -> pp .getParty ().getCreatedAt (),
204+ Comparator .reverseOrder ()))
201205 .map (pp -> {
202206 Party party = pp .getParty ();
203207 int currentParticipants = participantRepository
You can’t perform that action at this time.
0 commit comments