-
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
33 - letter controller #34
Merged
Merged
Conversation
This file contains 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
인증정보를 SecurityContextHolder에서 받아오도록 수정하였으므로, 이에 맞춰 비즈니스 로직 수정
편지 전체 정보를 간단히 넘겨주는 api구현, 클라이언트 사이드에서 필요한 정보만을 넘겨주기 위해 각 데이터의 order, uid같은 불 필요한 정보를 제외하고 새로 매핑하여 넘겨주는 형태로 구현.
query param으로 다양한 검색 조건 값을 받아와 필요한 정보만을 클라이언트 사이드로 줄 수 있도록 구현
편지를 삭제하는 기능 구현 PostMapping이기 때문에 RequestBody로 받으므로 RequestDto를 따로 생성함.
Auditing 정보 자동 삽입을 위해 EnableJpaAuditing 추가하는 것을 까먹음. 이를 추가
테스트용 데이터 추가
letter를 추가하는 기능 및 Dto 구현. route는 create로 해놓았지만 컨트롤러 및 서비스에서는 saveLetter로 이름을 지어놨는데, 기준을 잘 모르겠다. 추후에 가능하면 알아볼 예정임.
createdAt 필드는 수정이 불가능한 필드이므로 updatable 속성을 false로 해놓음. 이로 써 데이터의 일관성(consistency), 신뢰성(reliability)과 무결성(integrity)를 보장받게 함.
SaveLetterRequest보다 LetterSaveRequest로 하는 것이 좋다. 이로써 가독성 및 유지보수성이 향상된다.
일관성을 위해 기존 DTO에 정의된 order필드를 partOrder로 변경
LetterScene 배열 필드에 대한 remove, add 메서드 추가.
편지를 업데이트할 수 있는 기능 구현 및 추가. requestDto가 LetterCreateRequest와 유사하기 때문에 이를 통합할 수 있을지 고민할 예정임.
업데이트시 LetterSceneList가 partOrder에 따라 정렬이 되지 않음을 발견. 이를 수정
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.
이 pr은 Letter에 대한 비즈니스 로직을 수행할 수 있는 Controller를 구현한다.
this closes #33