Refactor: ResponseDto 추가 및 코드컨벤션 적용 #238
Merged
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.
작업 개요
작업 사항
로그인할 때 토큰을 내려주는데 해당 응답을 ResponseDto를 만들어서 내려주도록 했습니다. 원래는 로그인에서만 쓰이는 dto인데 따로 정의를 하게 되면 불필요하게 너무 많은 dto들이 존재하게 될 것 같아 오히려 안 좋을 것이라고 생각했습니다. 그런데 swagger 설정을 하면서 응답 형식을 지정해줘야하는데 swagger 설정 형식과 실제 내려주는 응답을 통일시키기 위해서는 dto를 정의하는 게 좋겠다고 생각했습니다.
dto를 작성할 때 어떤 파일은
user.update.ts
형식으로 되어있고 어떤 파일은enter-lecture.dto.ts
형식으로 되어있어 컨벤션을 맞추는 과정이 필요하겠다고 생각해 파일 이름을 수정하였습니다.컨벤션 중 아래의 내용을 참고하여 수정하였습니다.
kebab-case
로 작성하고 목적을 "."으로 구분하여 작성해요.user-article.contorller.js