-
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
[FEAT] 대기열 구현 #32
base: main
Are you sure you want to change the base?
[FEAT] 대기열 구현 #32
Conversation
- 대기열 진입 API - 웨이팅 수 반환 요청 API - 웨이팅 큐 탈출 API
- 기존 Manager를 두었던 체계에서 상위에 facade서비스를 두는 방식으로 변경하였습니다.
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.
엄청 잘 짜셔서 특별히 리뷰 남길만한게 별로 없네요...
저도 나름 잘 짰다고 생각했는데 처리를 휠씬 세세하게 잘 하신것 같습니다!
제가 아까 보니까 수민님만 메인 브랜치에 머지를 못해봐서 컨트리뷰터에 이름이 없던데
코드도 잘 작성하신거 같고 제 코드 리뷰후에 적당히 합쳐서 수민님 코드로 머지하셔도 좋을 것 같습니다!
고생하셨습니다~
private final SecretKey secretKey; | ||
private final Integer expirationTime; | ||
private static final String SIGNATURE_ALGORITHM = Jwts.SIG.HS256.key().build().getAlgorithm(); | ||
|
||
JwtUtil(@Value("${jwt.secret}") String secretKey, @Value("${jwt.expiration_time}") Integer expirationTime) { | ||
this.secretKey = new SecretKeySpec(secretKey.getBytes(StandardCharsets.UTF_8), SIGNATURE_ALGORITHM); | ||
this.expirationTime = expirationTime; | ||
} |
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.
사실 저는 무슨 auth0-jwt 였나 하는 라이브러리만 써보고
jjwt 라이브러리를 처음 써봐서 엄청 엉성한데 한 수 배워갑니다.
@Service | ||
@Transactional | ||
@RequiredArgsConstructor | ||
public class QueueServiceImpl implements QueueService { |
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.
P3
여기에 @transactional은 필요 없지 않을까요??
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.
그로네용..습관이 무섭습니다....
@Scheduled(fixedRate = 30 * 1000) //30초마다 | ||
public void updateWaitingToProcessing() { | ||
queueCommandService.removeExpiredToken(); | ||
queueCommandService.updateWaitingToProcessing(); | ||
log.info("processing queue 가 update 되었습니다."); | ||
} |
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.
저는 만료된 토큰 제거는 생각하지도 않았네요 ㅜㅠㅠㅠ
import static com.example.book_your_seat.queue.QueueConst.*; | ||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
public class QueueServiceTest extends IntegralTestSupport { |
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.
혹시 테스트의 for들이 전부 1000번 부터 시작하는데 이유가 있을까요?
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.
그냥 혹시라도 아까처럼 id문제가 생길까봐 안전하게 했습니다 ㅎㅎㅎ
📌 과제 설명
대기열 서비스를 구현했습니다.
👩💻 요구 사항과 구현 내용
1. 큐 진입 API (토큰발급)
2. 큐 정보 반환 요청 API (상태랑 대기 수)
3. 대기 큐 탈출 API
4. 예매 성공 시 진행 큐 탈출 요청 함수 작성
5. 30초마다 대기큐 -> 처리큐 Update 스케줄러 작성
✅ PR 포인트 & 궁금한 점
빼먹은게 있으면 편하게 말씀 주쎄요~!
그리고 yml 파일을 따로 .gitignore 처리 해두지 않아서 jwt관련 정보들이 공개되어있는데, 임시니까 일단 공개해둡니다!!