-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat : 예매대기 처리 스케줄러 구현 #43
Changes from 4 commits
a384874
b350dfa
239049b
6cff378
0b86696
7901712
8921b03
566ab5d
5aa39f2
0924434
47d2ab0
6c771ce
5d75bc6
b84ab45
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,7 @@ | |
|
||
public interface UserRepository { | ||
|
||
User save(User user); | ||
|
||
Optional<User> findById(Long id); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
import static jakarta.persistence.FetchType.*; | ||
import static jakarta.persistence.GenerationType.*; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
|
@@ -52,6 +53,8 @@ public class WaitingBooking extends TimeBaseEntity { | |
|
||
private int seatCount; | ||
|
||
private LocalDateTime expireAt; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. expiredAt 은 어떤가요?! (근데 사실 너무 사소함 ㅎㅎ) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 의미적으로 그게 더 맞는거같네요! 수정하겠습니다 ㅎㅎ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. b84ab45 |
||
|
||
@OneToMany(mappedBy = "waitingBooking", cascade = {REMOVE, PERSIST}) | ||
List<WaitingBookingSeat> waitingBookingSeats = new ArrayList<>(); | ||
|
||
|
@@ -108,4 +111,10 @@ public static WaitingBooking of( | |
) { | ||
return new WaitingBooking(user, seatCount, seatIds); | ||
} | ||
|
||
public List<Long> getSelectedSeatIds() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 예약 대기 좌석에 해당하는 좌석 id값을 list로 반환하는 함수가 맞을까요? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 네 맞습니다~ 👍 |
||
return waitingBookingSeats.stream() | ||
.map(WaitingBookingSeat::getSeatId) | ||
.toList(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
dependencies { | ||
implementation project(':core') | ||
testImplementation(testFixtures(project(':core'))) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package dev.hooon; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
@SpringBootApplication | ||
public class SchedulerApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(SchedulerApplication.class, args); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
spring: | ||
jpa: | ||
show-sql: true | ||
hibernate: | ||
ddl-auto: create | ||
properties: | ||
hibernate: | ||
dialect: org.hibernate.dialect.PostgreSQLDialect | ||
format_sql: true | ||
|
||
logging: | ||
level: | ||
org.hibernate.sql: info |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 스케줄러 모듈 설정 잘 추가하신 것 같아요! 👍🏻 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ rootProject.name = 'interpark' | |
|
||
include 'api' | ||
include 'core' | ||
include 'scheduler' | ||
|
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.
👍🏻👍🏻