-
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
GTB-31 [feat] 입장 완료 구현 #27
Conversation
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.
의견을 남겨놓았습니다. 읽고 수정혹은 다른 의견 부탁드립니다
src/main/java/site/gachontable/gachontablebe/domain/admin/usecase/ForceCancel.java
Outdated
Show resolved
Hide resolved
@@ -50,6 +50,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { | |||
authorize | |||
.requestMatchers("/v3/api-docs/**", "/swagger-ui/**").permitAll() | |||
.requestMatchers("/admin/login").permitAll() | |||
.requestMatchers("/admin/force-cancel").permitAll() |
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.
테스트를 위해 권한을 풀어주신 것 같은데 어드민 로그인이 구현되면 꼭 수정해주셔야 할 것 같습니다
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.
의견을 남겨놓았습니다. 읽고 수정혹은 다른 의견 부탁드립니다
src/main/java/site/gachontable/gachontablebe/domain/admin/presentation/AdminController.java
Outdated
Show resolved
Hide resolved
@@ -35,4 +38,10 @@ public ResponseEntity<JwtResponse> login(@RequestBody AdminLoginRequest request) | |||
JwtResponse tokens = adminLogin.execute(request.id(), request.password()); | |||
return ResponseEntity.ok(tokens); | |||
} | |||
|
|||
@PostMapping("/force-cancel") | |||
public ResponseEntity<String> forceCancel(@RequestBody ForceCancelRequest request) { |
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.
현재 토큰이 구현되어 있지 않아 빠져있지만 차후 Authentication 혹은 token 을 받아와야 할 것 같습니다.
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.
Admin
의 경우 현재 토큰이 구현되어 있기 때문에 토큰 방식으로 인증 진행하면 될 것 같습니다!
따라서 @RequestHeader
을 통해 인증하는 방식으로 컨트롤러단을 수정해주시면 좋을 것 같습니다.
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.
고생하셨습니다!
현재 강제 예약 삭제를 구현하실 때 POST 메서드로 구현을 하신 것 같습니다.
그런데 해당 api 경로 즉, /force-cancel로 예약을 하지 않았을 때 예약 취소 요청을 보냈을 때, 그리고 예약을 강제 취소하고 다시 예약 취소 요청을 보냈을 때 어떻게 로직이 처리가 되는지 궁금합니다.
src/main/java/site/gachontable/gachontablebe/domain/admin/presentation/AdminController.java
Outdated
Show resolved
Hide resolved
src/main/java/site/gachontable/gachontablebe/domain/admin/presentation/AdminController.java
Outdated
Show resolved
Hide resolved
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.
고생하셨습니다!
몇 가지 고쳐야 할 부분들 확인해주시면 감사하겠습니다 😄
src/main/java/site/gachontable/gachontablebe/domain/user/domain/repository/UserRepository.java
Outdated
Show resolved
Hide resolved
src/main/java/site/gachontable/gachontablebe/global/error/ErrorCode.java
Outdated
Show resolved
Hide resolved
src/main/java/site/gachontable/gachontablebe/global/error/ErrorCode.java
Outdated
Show resolved
Hide resolved
src/main/java/site/gachontable/gachontablebe/domain/admin/dto/ForceCancelRequest.java
Outdated
Show resolved
Hide resolved
src/main/java/site/gachontable/gachontablebe/domain/admin/dto/ForceCancelRequest.java
Outdated
Show resolved
Hide resolved
src/main/java/site/gachontable/gachontablebe/domain/admin/usecase/ForceCancel.java
Outdated
Show resolved
Hide resolved
src/main/java/site/gachontable/gachontablebe/domain/admin/usecase/ForceCancel.java
Outdated
Show resolved
Hide resolved
src/main/java/site/gachontable/gachontablebe/domain/admin/usecase/ForceCancel.java
Outdated
Show resolved
Hide resolved
src/main/java/site/gachontable/gachontablebe/domain/waiting/domain/Waiting.java
Outdated
Show resolved
Hide resolved
src/main/java/site/gachontable/gachontablebe/domain/user/domain/User.java
Outdated
Show resolved
Hide resolved
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.
�우선 고생하셨다는 말씀 드립니다!
또한 기존에 상의되지 않은 기능임을 뒤늦게 파악한 점에 있어서 죄송하다는 말씀 드립니다.
해당 부분같은 경우는 슬랙 및 스크럼을 통해 얘기를 나누도록 하겠습니다! 😄
src/main/java/site/gachontable/gachontablebe/domain/admin/dto/ForceCancelRequest.java
Outdated
Show resolved
Hide resolved
@@ -35,4 +38,10 @@ public ResponseEntity<JwtResponse> login(@RequestBody AdminLoginRequest request) | |||
JwtResponse tokens = adminLogin.execute(request.id(), request.password()); | |||
return ResponseEntity.ok(tokens); | |||
} | |||
|
|||
@PostMapping("/force-cancel") | |||
public ResponseEntity<String> forceCancel(@RequestBody ForceCancelRequest request) { |
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.
Admin
의 경우 현재 토큰이 구현되어 있기 때문에 토큰 방식으로 인증 진행하면 될 것 같습니다!
따라서 @RequestHeader
을 통해 인증하는 방식으로 컨트롤러단을 수정해주시면 좋을 것 같습니다.
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.
기존에 저희 서비스는 최초 호출 이후 5분 경과시 자동 취소 처리되도록 MVP를 설정했었는데,
해당 부분에서 로직의 변경이 불가피할 것 같습니다.
만약 강제 예약 취소를 추가한다고 하면 해당 기능은 Admin
이 관리하는 것이기 때문에
- Admin이 강제취소하려는 해당 주점의 권한을 가지고 있는지 확인 (FK로 구성)
- 해당 Admin의 FK에 존재하는 Waiting과 User간의 연관관계 확인
을 수행하는 로직이 추가적으로 이루어져야 할 것 같습니다.
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.
네 알겠습니다. 해당 부분 수정하도록 하겠습니다.
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.
고생하셨습니다! 몇 가지 의견을 달았으니 확인 부탁드립니다🙏
@ApiResponse(responseCode = "404", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), | ||
@ApiResponse(responseCode = "500", content = @Content(schema = @Schema(implementation = ErrorResponse.class))) | ||
}) | ||
@PostMapping("/entered") |
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.
rest api 규칙에 따라
/enter
로 uri를 변경하면 좋을 것 같습니다!
@ApiResponse(responseCode = "500", content = @Content(schema = @Schema(implementation = ErrorResponse.class))) | ||
}) | ||
@PostMapping("/entered") | ||
public ResponseEntity<String> entered(Authentication authentication, @RequestBody EnteredRequest enteredRequest) { |
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.
저희 로직은 Authentication
을 사용하지 않습니다.
따라서 다른 컨트롤러 클래스를 참고하여 @RequestHeader
형식으로 바꿔주시면 좋을 것 같습니다!
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class Entered { |
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.
클래스명도 uri에 맞게 수정 부탁드립니다!
@@ -55,6 +55,10 @@ public Waiting(Position waitingType, Integer headCount, Status waitingStatus, Us | |||
this.pub = pub; | |||
} | |||
|
|||
public void entered() { |
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.
uri
에 맞게 메서드명 수정 부탁드립니다!
@@ -50,6 +50,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { | |||
authorize | |||
.requestMatchers("/v3/api-docs/**", "/swagger-ui/**").permitAll() | |||
.requestMatchers("/admin/login").permitAll() | |||
.requestMatchers("/admin/force-cancel").permitAll() |
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.
uri
명 수정 부탁드립니다!
src/main/java/site/gachontable/gachontablebe/domain/admin/dto/EnteredRequest.java
Outdated
Show resolved
Hide resolved
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.
클래스명 관련하여 수정 부탁드립니다!
src/main/java/site/gachontable/gachontablebe/domain/admin/presentation/AdminController.java
Show resolved
Hide resolved
|
||
private final UserRepository userRepository; | ||
private final WaitingRepository waitingRepository; | ||
private final PubRepository pubRepository; | ||
private final AdminRepository adminRepository; | ||
private final JwtProvider jwtProvider; | ||
|
||
public String enter(String authorizationHeader, EnterRequest enterRequest) { | ||
public String enterUser(String authorizationHeader, EnterUserRequest enterUserRequest) { |
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.
메서드명과 클래스명이 일치해 가독성이 조금 떨어지는 것 같습니다!
적절한 이름으로 변경해주시면 감사하겠습니다..!!
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.
변경 완료하였습니다!
1. 무슨 이유로 코드를 변경했나요?
사용자가 입장을 완료하면 관리자가 입장 완료 버튼을 눌러 입장을 완료 시키는 API를 개발했습니다.
2. 어떤 위험이나 장애를 발견했나요?
2.QueingCount가 0일 경우에도 완료 로직이 수행되는 것을 수정하였습니다.
3. 관련 스크린샷을 첨부해주세요.
아래 처럼 QueingCount가 0이먄 예외가 발생하도록 처리하였습니다.
4. 완료 사항
5. 추가 사항