[SCG] 손희창 방탈출예약 1-3단계 제출합니다.#229
Open
mikeylili wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
안녕하세요!
노베에서 Spring을 배워가고 있습니다.
현재 ReservationRequest에서 Setter를 안쓰기 위해, 서비스 레이어에서 조건문으로 reservationName을 결정한 뒤 Dao 파라미터로 넘겨주는 방식을 선택했습니다. 혹시 서비스 레이어가 아니라 ReservationRequest 내부에 새로운 형식의 객체를 만드는 메서드를 넣어 기존 예약 데이터에 String newname을 포함한 새로운 객체를 만드는 메서드를 넣는 방식도 괜찮은 구조일지 궁금합니다.
그리고 3단계 구현(Intercept)에서 힌트 코드 구조는
이거였는데 사실 이 코드에서는 ...에 MemberResponse member = memberService.findMemberByToken(token);가 들어갈 텐데
그러면 findMemberByToken메서드 안에 Member member = memberDao.findByName(name);에서 DB를 다시 조회하게 되는데
사실 토큰을 만들때.claim("role", member.getRole()) 롤도 같이 넣어줘서 힌트 코드 구조를 조금 벗어나게 토큰 자체에서 Jwts를 활용해 Role만 꺼내오는 방식으로 코드를 짜봤습니다.
혹시 힌트 코드 구조가 원래 요구하는건 토큰을 식별자로 해서 DB를 다시 조회해서 Role을 가져오는 방식이 맞을까요?
제 방식에는 문제점이 있을까요?
잘못되거나 개선되어야할 코드가 있다면 꼭 말씀주시면 감사하겠습니다.
수~금까지는 여행일정이 있어서 토요일에 리뷰 확인하고 리뷰 반영하겠습니다!
잘부탁드립니다!