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

33 - letter controller #34

Merged
merged 13 commits into from
Sep 3, 2024
Merged

33 - letter controller #34

merged 13 commits into from
Sep 3, 2024

Conversation

kangdaelyeol
Copy link
Owner

이 pr은 Letter에 대한 비즈니스 로직을 수행할 수 있는 Controller를 구현한다.

this closes #33

인증정보를 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에 따라 정렬이 되지 않음을 발견. 이를 수정
@kangdaelyeol kangdaelyeol added the enhancement New feature or request label Sep 3, 2024
@kangdaelyeol kangdaelyeol self-assigned this Sep 3, 2024
@kangdaelyeol kangdaelyeol merged commit e0161cc into main Sep 3, 2024
@kangdaelyeol kangdaelyeol deleted the feature/33-letter-controller branch September 3, 2024 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

편지 컨트롤러 구현
1 participant