[#57] feature: 실시간 피드 api 인증, 필터링, 테스트 코드 추가 #61
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
관련 이슈
📌 작업 개요
/api/v1/office/dispatch/feedAPI에 사무실 인증 및 데이터 격리 기능 추가주요 변경 사항
1. 인증 추가
@AuthenticationPrincipal PrincipalDetails user파라미터 추가2. 데이터 필터링
getDispatchFeed(Integer limit, Manager manager)메서드 수정dispatch.officeId == manager.office.id(현재 사무실 배차만)dispatch.status != HOLD(자동배차 진행중 제외)3. 테스트 코드
OfficeV1ControllerTest (5개 테스트)
OfficeServiceTest (6개 테스트)
파일 변경
src/main/java/com/mobility/api/domain/office/
├── controller/OfficeV1Controller.java # 인증 파라미터 추가
└── service/OfficeService.java # officeId 필터링 로직 추가
src/test/java/com/mobility/api/domain/office/
├── controller/OfficeV1ControllerTest.java # NEW (5 tests)
└── service/OfficeServiceTest.java # NEW (6 tests)
보안 개선
✨ 기타 참고 사항
id필드가 포함되지 않아, 테스트 코드에서 Reflection을 사용하여 id를 설정했습니다.@CurrentUser어노테이션은 TransporterV1Controller에서만 사용 중이며, OfficeV1Controller는@AuthenticationPrincipal PrincipalDetails방식을 사용 합니다.✅ 체크리스트
application.yml파일을 수정했다면, Notion에 업로드, github security 수정 및 공유했어요.