@@ -153,44 +153,63 @@ public ResponseEntity<ApiResponse<PartyDto>> getPartyDetails(@PathVariable Integ
153153 }
154154
155155 @ PostMapping ("/{partyId}/invite" )
156- @ Operation (summary = "파티 초대 (코드) " , description = "파티장이 다른 멤버를 코드를 사용하여 파티에 초대하는 API " )
157- public ResponseEntity <ApiResponse <Void >> inviteMember (
156+ @ Operation (summary = "파티에 멤버 초대 " , description = "파티장이 멤버 코드로 다른 사용자를 파티에 초대합니다. 상태는 INVITED로 설정됩니다. " )
157+ public ResponseEntity <ApiResponse <PartyMemberStatusResponse >> inviteMember (
158158 @ PathVariable Integer partyId ,
159- @ RequestBody @ Valid InvitationDto invitationDto ,
159+ @ Valid @ RequestBody InvitationDto invitationDto ,
160160 Authentication authentication
161161 ) {
162162 Integer leaderId = getMemberIdFromAuthentication (authentication );
163- partyService .inviteMember (partyId , leaderId , invitationDto .getInvitedMemberCode ());
163+
164+ PartyMemberStatusResponse responseContent = partyService .inviteMember (
165+ partyId ,
166+ leaderId ,
167+ invitationDto .getInvitedMemberCode ()
168+ );
164169
165170 return ResponseEntity
166171 .status (HttpStatus .OK )
167- .body (ApiResponse .success ("200" , "파티 초대 성공" ));
172+ .body (ApiResponse .success ("200" , "초대 성공" , responseContent ));
168173 }
169174
170175 @ PostMapping ("/{partyId}/accept" )
171- @ Operation (summary = "초대/신청 수락" , description = "초대/신청 대기 중인 멤버를 파티원이 되도록 수락하는 API " )
172- public ResponseEntity <ApiResponse <Void >> acceptInvitation (
176+ @ Operation (summary = "파티 가입 신청/초대 수락" , description = "파티장이 대기 중인 멤버의 가입 신청 또는 초대를 수락합니다. (PENDING | INVITED) -> ACCEPTED " )
177+ public ResponseEntity <ApiResponse <PartyMemberStatusResponse >> acceptInvitation (
173178 @ PathVariable Integer partyId ,
179+ @ Valid @ RequestBody MemberIdRequest memberIdRequest ,
174180 Authentication authentication
175181 ) {
176- Integer memberId = getMemberIdFromAuthentication (authentication );
177- partyService .acceptInvitation (partyId , memberId );
182+ Integer leaderId = getMemberIdFromAuthentication (authentication );
183+
184+ PartyMemberStatusResponse responseContent = partyService .acceptInvitation (
185+ partyId ,
186+ memberIdRequest .getMemberId (),
187+ leaderId
188+ );
189+
178190 return ResponseEntity
179191 .status (HttpStatus .OK )
180- .body (ApiResponse .success ("200" , "초대/신청 수락 성공" ));
192+ .body (ApiResponse .success ("200" , "초대/신청 수락 성공" , responseContent ));
181193 }
182194
183195 @ PostMapping ("/{partyId}/reject" )
184- @ Operation (summary = "초대/신청 거절" , description = "초대/신청 대기 중인 멤버를 거절하는 API " )
185- public ResponseEntity <ApiResponse <Void >> rejectInvitation (
196+ @ Operation (summary = "파티 가입 신청/초대 거절 (소프트 삭제) " , description = "파티장이 대기 중인 멤버의 신청 또는 초대를 거절하고 상태를 REJECTED로 변경합니다. (PENDING | INVITED) -> REJECTED " )
197+ public ResponseEntity <ApiResponse <PartyMemberStatusResponse >> rejectInvitation (
186198 @ PathVariable Integer partyId ,
199+ @ Valid @ RequestBody MemberIdRequest memberIdRequest ,
187200 Authentication authentication
188201 ) {
189- Integer memberId = getMemberIdFromAuthentication (authentication );
190- partyService .rejectInvitation (partyId , memberId );
202+ Integer leaderId = getMemberIdFromAuthentication (authentication );
203+
204+ PartyMemberStatusResponse responseContent = partyService .rejectInvitation (
205+ partyId ,
206+ memberIdRequest .getMemberId (),
207+ leaderId
208+ );
209+
191210 return ResponseEntity
192211 .status (HttpStatus .OK )
193- .body (ApiResponse .success ("200" , "초대/신청 거절 성공" ));
212+ .body (ApiResponse .success ("200" , "초대/신청 거절 성공" , responseContent ));
194213 }
195214
196215 @ DeleteMapping ("/{partyId}/members/{kickedMemberId}" )
@@ -209,15 +228,15 @@ public ResponseEntity<ApiResponse<Void>> kickMember(
209228 }
210229
211230 @ GetMapping ("/{partyId}/requests" )
212- @ Operation (summary = "파티 가입 신청/초대 목록 조회" , description = "파티장이 가입 신청 또는 초대 대기 중인 멤버 목록을 조회하는 API " )
231+ @ Operation (summary = "파티 가입 신청/초대 목록 조회" , description = "파티장이 PENDING(신청) 또는 INVITED(초대) 대기 중인 멤버 목록을 조회합니다. 응답에 status 필드가 포함됩니다. " )
213232 public ResponseEntity <ApiResponse <List <PartyMemberDto >>> getPendingJoinRequests (
214233 @ PathVariable Integer partyId ,
215234 Authentication authentication
216235 ) {
217236 Integer leaderId = getMemberIdFromAuthentication (authentication );
218237 List <PartyMember > pendingRequests = partyService .getPendingJoinRequests (partyId , leaderId );
219238 List <PartyMemberDto > requestDtos = pendingRequests .stream ()
220- .map (pm -> new PartyMemberDto (pm .getMember ()))
239+ .map (pm -> new PartyMemberDto (pm .getMember (), pm . getStatus (). name () ))
221240 .collect (Collectors .toList ());
222241
223242 return ResponseEntity
0 commit comments