public class NungilMatchResponse {
@Nullable
private String yoil;
@Nullable
private String time;
private List<AvailableMarker> marker;
private String location;
@Nullable
private Long chatRoomId;
...
}
3️⃣ API 요청을 보낸 사용자 권한 확인 로직 추가
현재 nungilId만 있으면 다른 사람의 매칭된 눈길 정보을 누구나 확인할 수 있는 문제 발생
Principal을 통해 요청한 사용자 정보를 조회한 다음, 눈길의 소유자인지 확인하는 로직 추가
public NungilMatchResponse getMatchedNungil(Long nungilId, Member member){
Nungil nungil = nungilRepository.findById(nungilId)
.orElseThrow(() -> new GeneralException(NungilErrorResult.NUNGIL_NOT_FOUND));
// 요청을 보낸 사용자가 주어진 눈길의 소유자인지 확인한다.
if (!nungil.getMember().equals(member)) {
throw new GeneralException(MemberErrorResult.NOT_OWNER);
}
...
}
🔥 Related Issues
💜 작업 내용
✅ PR Point
1️⃣Nungil 엔티티의 서로 겹치는 요일, 시간, 마커 리스트를 Enum 변경
2️⃣매칭된 눈길 상세 조회 응답 데이터 수정
null
반환3️⃣ API 요청을 보낸 사용자 권한 확인 로직 추가
nungilId
만 있으면 다른 사람의 매칭된 눈길 정보을 누구나 확인할 수 있는 문제 발생Principal
을 통해 요청한 사용자 정보를 조회한 다음, 눈길의 소유자인지 확인하는 로직 추가4️⃣ 판교 마커 데이터
😡 Trouble Shooting