-
Notifications
You must be signed in to change notification settings - Fork 0
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
[NO_JIRA] 블록별 좌석 범위 조회 API request 수정 #43
Conversation
|
||
import org.depromeet.spot.jpa.block.entity.BlockEntity; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface BlockJpaRepository extends JpaRepository<BlockEntity, Long> { | ||
Optional<BlockEntity> findByStadiumIdAndCode(Long stadiumId, String code); |
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.
블럭 코드는 경기장 내에서만 unique하기 때문에, stadiumId를 추가로 이용했어요~
@Override | ||
public List<BlockRow> findAllByStadiumAndBlock(Long stadiumId, String blockCode) { | ||
List<BlockRowEntity> entities = | ||
blockRowJpaRepository.findAllByStadiumAndBlock(stadiumId, blockCode); | ||
return entities.stream().map(BlockRowEntity::toDomain).toList(); | ||
} |
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.
요건 생각해보니까, 어차피 로직상 stadiumId랑 code로 블럭을 먼저 찾을테니, 이후 blockId만 get해서 써도 되겠네요..!
이렇게 구현해도 딱히 문제는 없으니까 일단 현상 유지할게요~
📌 개요 (필수)
🔨 작업 사항 (필수)
💻 실행 화면 (필수)