Skip to content
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

콘서트 좌석정보 수정, 콘서트 상태 close로 변경 API 개발 및 콘서트 상태 open 변경 스케줄러 작업 추가 #4

Merged
merged 3 commits into from
Oct 26, 2024

Conversation

plere
Copy link
Collaborator

@plere plere commented Oct 14, 2024

No description provided.

);
}

@PutMapping("/{id}/state/close")

Choose a reason for hiding this comment

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

/{id}/close 로 해도 될것 같습니다.

@@ -141,4 +145,43 @@ public Concert updatePlace(Place place, List<ConcertSeat> seats) {
.seats(List.copyOf(seats))
.build();
}

public Concert changeState(ConcertState state) {

Choose a reason for hiding this comment

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

메서드명이 changeState 인데 실제로는 get 을 수행하는것 같습니다.

getListVo.name() != null ? concertEntity.name.contains(getListVo.name()) : null,
getListVo.placeName() != null ? placeEntity.name.contains(getListVo.name()) : null,
getListVo.state() != null ? concertEntity.state.eq(getListVo.state()) : null,
getListVo.openTime() != null ? concertEntity.openTime.loe(getListVo.openTime()) : null

Choose a reason for hiding this comment

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

contains 조건절은 성능 저하가 심합니다.

Choose a reason for hiding this comment

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

loe 보다는 임의의 시간을 줘서 between 으로 하시는게 좋습니다.


public List<ConcertEntity> getList(GetConcertListVo getListVo) {
return selectFrom(concertEntity)
.leftJoin(concertEntity.placeEntity, placeEntity)

Choose a reason for hiding this comment

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

leftJoin 은 성능 저하가 커서 케이스에 따라 나누는 걸 추천드립니다.

Choose a reason for hiding this comment

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

InnerJoin 으로도 괜찮을거 같아요.

Copy link

sonarcloud bot commented Oct 21, 2024

@plere plere merged commit a6b2c82 into main Oct 26, 2024
2 checks passed
@plere plere deleted the feature/admin-concert branch November 1, 2024 07:19
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