-
Notifications
You must be signed in to change notification settings - Fork 0
[feat] 배달팟 참여자 목록 조회 API 구현 #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,10 @@ | |
| import com.leets.tdd.party.dto.request.UpdateDeliveryPartyRequest; | ||
| import com.leets.tdd.party.dto.response.CreateDeliveryPartyResponse; | ||
| import com.leets.tdd.party.dto.response.DeliveryPartyDetailResponse; | ||
| import com.leets.tdd.party.dto.response.PartyParticipantListResponse; | ||
| import com.leets.tdd.party.service.DeliveryPartyService; | ||
| import com.leets.tdd.global.common.ApiResponse; | ||
| import com.leets.tdd.global.jwt.UserPrincipal; | ||
|
|
||
| import lombok.RequiredArgsConstructor; | ||
|
|
||
|
|
@@ -23,7 +26,7 @@ | |
|
|
||
|
|
||
| @RestController | ||
| @RequestMapping("/api/v1/delivery-parties") | ||
| @RequestMapping({"/api/v1/delivery-parties", "/api/v1/parties"}) | ||
| @RequiredArgsConstructor | ||
| public class DeliveryPartyController { | ||
|
|
||
|
|
@@ -68,6 +71,17 @@ public ResponseEntity<DeliveryPartyDetailResponse> getDeliveryPartyDetail( | |
| } | ||
|
|
||
|
|
||
| // 배달팟 참여자 목록 조회 API | ||
| @GetMapping("/{partyId}/participants") | ||
| public ResponseEntity<ApiResponse<PartyParticipantListResponse>> getPartyParticipants( | ||
| @PathVariable Long partyId, | ||
| @AuthenticationPrincipal UserPrincipal currentUser | ||
| ) { | ||
| PartyParticipantListResponse response = deliveryPartyService.getPartyParticipants(partyId); | ||
| return ResponseEntity.ok(ApiResponse.success("참여자 목록 조회에 성공했습니다.", response)); | ||
| } | ||
|
Comment on lines
+75
to
+82
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== locate file =="
fd -a 'DeliveryPartyController.java|DeliveryPartyService.java|.*Swagger.*|.*OpenApi.*|.*ApiDoc.*' . | sed 's#^\./##' | head -h 100
echo "== target controller outline =="
if [ -f src/main/java/com/leets/tdd/party/controller/DeliveryPartyController.java ]; then
ast-grep outline src/main/java/com/leets/tdd/party/controller/DeliveryPartyController.java || true
echo "== target controller relevant section =="
cat -n src/main/java/com/leets/tdd/party/controller/DeliveryPartyController.java | sed -n '1,140p'
else
echo "target file not found"
fi
echo "== swagger annotations around target =="
rg -n "@(Operation|ApiResponse|SecurityIgnore|SecurityScheme|SecurityRequirement|Tag|SecurityAspect|ApiSecurity|Authorization|ErrorResponse|SecurityResponse|SecuritySchema|SecurityResponse|SecurityResponses|SecurityResponse)" src/main/java || true
echo "== global/api docs mentions =="
rg -n "Swagger|OpenAPI|openapi|`@io`\.swagger|`@springdoc`|ApiResponse|SecurityResponse|`@SecurityAnnotation`|`@SecurityResponses`|`@Security`" src/main/java || trueRepository: Leets-Official/TDD-BE Length of output: 245 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== locate file =="
fd 'DeliveryPartyController.java|DeliveryPartyService.java|.*Swagger.*|.*OpenApi.*|.*ApiDoc.*' . | sed 's#^\./##' | head -n 150
echo "== target controller outline =="
if [ -f src/main/java/com/leets/tdd/party/controller/DeliveryPartyController.java ]; then
ast-grep outline src/main/java/com/leets/tdd/party/controller/DeliveryPartyController.java || true
echo "== target controller relevant section =="
cat -n src/main/java/com/leets/tdd/party/controller/DeliveryPartyController.java | sed -n '1,140p'
else
echo "target file not found"
fi
echo "== swagger/security annotations around target =="
rg -n "@(Operation|ApiResponse|SecurityIgnore|SecurityScheme|SecurityRequirement|Tag|SecurityAspect|ApiSecurity|Authorization|ErrorResponse|SecurityResponse|SecuritySchema|SecurityResponses|SecurityResponse)" src/main/java || true
echo "== global/api docs mentions =="
rg -n "Swagger|OpenAPI|openapi|`@io`\.swagger|`@springdoc`|ApiResponse|SecurityResponse|`@SecurityAnnotation`|`@SecurityResponses`|`@Security`" src/main/java || trueRepository: Leets-Official/TDD-BE Length of output: 31350 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== party service outline =="
ast-grep outline src/main/java/com/leets/tdd/party/service/DeliveryPartyService.java || true
echo "== party service getPartyParticipants section =="
cat -n src/main/java/com/leets/tdd/party/service/DeliveryPartyService.java | sed -n '1,220p'
echo "== party controller security annotations =="
cat -n src/main/java/com/leets/tdd/party/controller/DeliveryPartyController.java | sed -n '1,120p' | rg -n "@(Operation|ApiResponse|SecurityIgnore|SecurityScheme|SecurityRequirement|Tag|ApiResponse|SecurityResponses|SecurityResponse)" || true
echo "== comparable documented controller sections =="
for f in \
src/main/java/com/leets/tdd/user/controller/UserController.java \
src/main/java/com/leets/tdd/settlement/controller/SettlementController.java \
src/main/java/com/leets/tdd/board/controller/PostController.java
do
if [ -f "$f" ]; then
echo "-- $f --"
rg -n -C 8 "@(Operation|ApiResponse|SecurityRequirement|Tag)" "$f" || true
fi
done
echo "== swagger config =="
cat -n src/main/java/com/leets/tdd/global/config/SwaggerConfig.javaRepository: Leets-Official/TDD-BE Length of output: 24829 Add Swagger documentation for participants retrieval.
🤖 Prompt for AI Agents |
||
|
|
||
|
|
||
| // 배달팟 수정 API | ||
| @PutMapping("/{partyId}") | ||
| public ResponseEntity<Void> updateDeliveryParty( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package com.leets.tdd.party.dto.response; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public record PartyParticipantListResponse( | ||
| Long partyId, | ||
| List<PartyParticipantResponse> participants | ||
| ) { | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package com.leets.tdd.party.dto.response; | ||
|
|
||
| public record PartyParticipantResponse( | ||
| Long userId, | ||
| String nickname, | ||
| String profileImage, | ||
| String role | ||
| ) { | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: Leets-Official/TDD-BE
Length of output: 8657
🏁 Script executed:
Repository: Leets-Official/TDD-BE
Length of output: 17286
Handle both registered participant-list routes.
DeliveryPartyControllermaps{partyId}/participantsunder both/api/v1/partiesand/api/v1/delivery-parties, but this exception handler only matches the former. Missing-token requests to/api/v1/delivery-parties/{partyId}/participantsfall through to the generic JWT error response instead of returning “로그인이 필요합니다.”Proposed fix
📝 Committable suggestion
🧰 Tools
🪛 ast-grep (0.44.1)
[warning] 33-35: Avoid writing untrusted input to the HTTP response
Context: response.getWriter().write(
objectMapper.writeValueAsString(ApiResponse.fail("로그인이 필요합니다."))
)
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
(xss-protection-java)
🤖 Prompt for AI Agents