Skip to content

Feature/ 후보 장소 조회 API 구현 #5

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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

leesanghuu
Copy link
Contributor

요약

  • 후보 장소 조회(Place) API 구현

내용

/meetings/{inviteCode}/places

  • inviteCode를 기반으로 해당 모임을 조회
  • 해당 모임에 연관된 RecommendedMidpoint 가져옴
  • 해당 RecommendedMidpointMidpoint에 매핑된 장소 (Place) 리스트 조회 후 DTO로 변환

참고

  • 하나의 중간지점(하나의 RecommendedMidpoint)만 사용자에게 제공한다는 점 반영했습니다.
  • Map-struct 이용한 PlaceMapper 이용해 DTO 변환했습니다.

import com.ODG.ODG_back.domain.RecommendedMidpoint;
import org.springframework.data.jpa.repository.JpaRepository;

public interface RecommendedMidpointRepository extends JpaRepository<RecommendedMidpoint, Long> {
RecommendedMidpoint findByMeeting(Meeting meeting);
Copy link
Contributor

Choose a reason for hiding this comment

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

RecommendedMidPoint를 List로 가져오는걸로 기억하고있었는데, 해당 코드에서는 미팅별로 하나의 장소만 선정되는 것 같습니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

저번 정기회의에서 모임별 중간지점을 하나씩만 선정하라고 해서 일단 하나만 가져오는 걸로 구현해봤어요

case PROJECT -> filterProjectPlaces(places);
};
}
private List<PlaceResponseDto> filterSocialPlaces(List<Place> places) {
Copy link
Contributor

Choose a reason for hiding this comment

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

전체적으로 매우 깔끔한 것 같은데, Social / Project 선택 시 필터링되는 장소 유형 목록들을 별도로 관리하면 코드를 조금 더 깔끔하게 관리할 수 있지않을까 합니다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

제가 보기에도 좀 별로인 것 같아서 MeetingTypePlaceCategory 매핑 추가해서 유형별 필터링이 가능하게 수정했습니다.
새로운 MeetingType이나 PlaceCategory 추가해도 enum만 수정하면 확장 가능할 듯 합니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants