-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature/seminar3 #3
Open
jinsu4755
wants to merge
17
commits into
30th-THE-SOPT-Server-Part:main
Choose a base branch
from
jinsu4755:feature/seminar3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature/seminar3 #3
jinsu4755
wants to merge
17
commits into
30th-THE-SOPT-Server-Part:main
from
jinsu4755:feature/seminar3
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
Contributor
jinsu4755
commented
Jun 10, 2022
- 실천과제 수행
- 발전 과제...는 DI 를 통한 의존성 분리를 하다가 개빡쳐서 잠시 멈춤 ^^
- 블로그 DB에 쓰고 불러오기 위한 Schema 구조 정의
- 스키마 구조이자 컬랙션에 대한 조회 및 수정을 하는 구조이기 때문에 이름을 변경함
- BlogSchema 를 통해 데이터를 주고 받기 위한 data interface 정의
- 들어오는 request body 값을 검증하기 위한 의존성 추가
- 들어온 body 값에 필요한 데이터가 모두 있는지 확인을 위한 검증 미들웨어 작성
- status, success, message, data 4가지를 담아주기 위한 기본 래핑 DTO 작성
- 받아온 Data나 status,message 를 통해 ResponseWarpDTO 를 만들기 위한 래퍼 클래스 작성
- request body 로 받은 값을 통해 데이터를 반환하여 처리하기 위한 DTO 작성
- BlogCreateDTO 및 해당 객체에서 id 를 통해 찾아온 User 정보를 바탕으로 블로그 도큐먼트를 추가하기 위한 Blog 타입 객체로 변환하는 역할을 가진 객체 작성
- 어떤 유저가 작성한 글인지 유저 정보를 찾기 위한 private findPostedUserById 함수 작성 - 글을 blogCreateDTO 를 바탕으로 실질적으로 저장하기 위한 createBlog 함수 작성
- Service 의존성 주입을 위한 typedi dependencies 추가
- 의존성 주입을 위해 런타임 reflect 를 지원하는 모듈 import
- Serive 에서 블로그를 작성한 결과 값의 데이터를 변환하여 보내주기 위한 DTO 작성
- /blog 에 대한 엔드포인트 처리를 위한 컨드롤러 함수 작성
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.