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

[jade.xyz] 방탈출 인증 관리 step3 과제 제출 #103

Merged
merged 6 commits into from
Feb 1, 2023

Conversation

mincastle98
Copy link

이번 과제는 테마 관리는 관리자만 할 수 있도록 관리자 권한을 추가하는 내용이었습니다.

Member 필드와 accessToken에 role을 추가하였고
권한 확인을 위한 Interceptor를 추가하였습니다.

추가로 생성자 관련해서 문제가 있던 부분은 ReservationRequest이었고 ReservationE2ETest에서 실패합니다.

@mincastle98
Copy link
Author

참고) FasterXML/jackson-module-parameter-names#38

Copy link

@jayden-17 jayden-17 left a comment

Choose a reason for hiding this comment

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

3단계 과제 잘 진행해주셨네요 ~ 고생하셨습니다 👍
덕분에 ParameterNamesModule 에 대해 같이 볼 수 있었어요 🙏
이번 PR은 merge 하도록 하겠습니다 😄

# Step 3

## 기능 요구사항

Choose a reason for hiding this comment

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

요구사항 정리 👍


@RestController
@RequestMapping("/admin/themes")
public class AdminController {

Choose a reason for hiding this comment

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

기존 ThemeController 와 AdminController 를 분리 👍

return HandlerInterceptor.super.preHandle(request, response, handler);
}

private void checkIsValidToken(HttpServletRequest request, HttpServletResponse response, String accessToken) throws ServletException, IOException {

Choose a reason for hiding this comment

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

accessToken 만으로 판단해서 예외를 던지는게 어떨까요 ?

import javax.servlet.http.HttpServletRequest;

@RestController
public class ExceptionController {

Choose a reason for hiding this comment

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

별도 예외 처리를 위한 controller 보다는 ExceptionHandler 로 유도할 수는 없을까요 ?

private Long themeId;
private String date;
private String time;
private final Long themeId;

Choose a reason for hiding this comment

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

불변객체 사용 👍

@jayden-17 jayden-17 merged commit e46f4a1 into 2023newkrew:mincastle98 Feb 1, 2023
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.

3 participants