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 @@ -29,6 +29,8 @@

import java.util.List;

import static ita.tinybite.global.response.APIResponse.*;

@Tag(name = "파티 API", description = "파티 생성, 조회, 참여 관련 API")
@RestController
@RequestMapping("/api/parties")
Expand Down Expand Up @@ -65,13 +67,10 @@ public class PartyController {
)
})
@PostMapping("/{partyId}/join")
public ResponseEntity<Long> joinParty(
public APIResponse<Long> joinParty(
@PathVariable Long partyId,
@Parameter(hidden = true) @AuthenticationPrincipal Long userId) {

partyService.joinParty(partyId, userId);

return ResponseEntity.ok().build();
return success(partyService.joinParty(partyId, userId));
}
Comment on lines +70 to 74
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n src/main/java/ita/tinybite/domain/party/controller/PartyController.java | head -100

Repository: tinybite-2025/tinybite-server

Length of output: 4545


🏁 Script executed:

fd -t f "PartyService.java"

Repository: tinybite-2025/tinybite-server

Length of output: 138


🏁 Script executed:

rg -t java "joinParty" --max-count=20

Repository: tinybite-2025/tinybite-server

Length of output: 442


🏁 Script executed:

cat -n src/main/java/ita/tinybite/domain/party/service/PartyService.java

Repository: tinybite-2025/tinybite-server

Length of output: 32115


🏁 Script executed:

rg -t java "public Long joinParty" -A 30

Repository: tinybite-2025/tinybite-server

Length of output: 3204


🏁 Script executed:

rg -t java "@ApiResponse" src/main/java/ita/tinybite/domain/party/controller/PartyController.java -A 3 | head -50

Repository: tinybite-2025/tinybite-server

Length of output: 1594


🏁 Script executed:

rg -t java "schema = @Schema" src/main/java/ita/tinybite/domain/party/controller/PartyController.java

Repository: tinybite-2025/tinybite-server

Length of output: 1200


joinParty 응답에서 반환되는 Long 값이 "1:1 채팅방 ID"임을 API 문서에 명확히 해야 함

PartyService.joinParty()oneToOneChatRoom.getId()를 반환하지만, 현재 Swagger 문서의 @ApiResponse(200) 응답 설명은 "참여 신청 성공"으로만 되어 있어 반환값의 의미가 명확하지 않습니다. @Schema 어노테이션을 추가하여 반환 값이 "1:1 채팅방 ID"임을 명시적으로 문서화하고, 프론트엔드 API 계약과 후속 호출 흐름을 이에 맞게 업데이트하세요.


@Operation(summary = "참여 승인", description = "파티장이 참여를 승인하면 단체 채팅방에 자동 입장됩니다")
Expand Down Expand Up @@ -496,7 +495,7 @@ public APIResponse<PartyQueryListResponse> getParty(
@RequestParam(defaultValue = "20") int size
) {

return APIResponse.success(partySearchService.searchParty(q, category, page, size, userLat, userLon));
return success(partySearchService.searchParty(q, category, page, size, userLat, userLon));
}

@Operation(
Expand All @@ -508,7 +507,7 @@ public APIResponse<PartyQueryListResponse> getParty(
)
@GetMapping("/search/log")
public APIResponse<List<String>> getRecentLog() {
return APIResponse.success(partySearchService.getLog());
return success(partySearchService.getLog());
}

@Operation(
Expand All @@ -521,7 +520,7 @@ public APIResponse<List<String>> getRecentLog() {
@DeleteMapping("/search/log/{keyword}")
public APIResponse<?> deleteRecentLog(@PathVariable String keyword) {
partySearchService.deleteLog(keyword);
return APIResponse.success();
return success();
}

@Operation(
Expand All @@ -533,6 +532,6 @@ public APIResponse<?> deleteRecentLog(@PathVariable String keyword) {
@DeleteMapping("/search/log")
public APIResponse<?> deleteRecentLogAll() {
partySearchService.deleteAllLog();
return APIResponse.success();
return success();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public Long joinParty(Long partyId, Long userId) {
partyId
);

return saved.getId();
return oneToOneChatRoom.getId();
}

private void validateProductLink(PartyCategory category, String productLink) {
Expand Down