-
Notifications
You must be signed in to change notification settings - Fork 1
common response 생성 및 테스트 router 생성 #30
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uvicorn app.main:app --reload
앞부분에 cd app이라고 되어있긴 한데 앞부분(cd app)을 지우던지 여기서 app.main:app을 main:app으로 해야할 지 정해야할 것 같습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그리고 동적포트라서
/app 인경우
python main.py or uvicorn main:app --host 0.0.0.0 --port 39722 --reload 이렇게 가야 되던데 그렇지 않나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
이 부분 원래 리드미에 적혀있는 대로 cd app 해서 진행하니 app 내부에 생기는 문제가 발생하더라고요.
그래서 현재 부분으로 수정했습니다.
cd app 부분이 clone한 프로젝트로 이해하고 넘어갔는데 아닌가요?? -
저 부분 포트를 지정해줄 필요가 있나요? main.py에서 지정해주기 때문에 main 위치만 지정해주면 되는 거 아닌가요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 이렇게 상태코드랑 비즈니스 코드를 나누는건 어떤 이점이 있는건가요? (그냥 궁금)
- 메시지 포맷팅부분은 이해가 되지않아 설명 부탁드립니다. 나의 AI는 저렇게 하면 안된다고 나오네요.
이 코드는 메시지에 포맷 자리가 정확히 있어야만 인자를 넣을 수 있어요. 없는데 넣으면 터집니다.이렇게요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 상태코드를 나누는 이유는 각각의 역할과 책임을 분리하고 관리 용이성, 프론트와 명확한 소통 때문이 나눈 것 입니다.
- 이해하지 못했습니다..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이제 앞으로 #테스트 라우터 부분처럼 작성해야하는거죠?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분은 라우터 pr과 합쳐지면 바뀌어야합니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
자, 여기까지의 흐름이
클라이언트 요청 → API 실행 -> API 내부에서 ResponseMessage.success(...) 호출 -> CommonCode에서 상태코드/메시지 가져옴 (code.code, code.get_message) -> ResponseMessage FastAPI 응답으로 리턴
맞나요?
ChoiSeungWoo98
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
리뷰 감사합니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
이 부분 원래 리드미에 적혀있는 대로 cd app 해서 진행하니 app 내부에 생기는 문제가 발생하더라고요.
그래서 현재 부분으로 수정했습니다.
cd app 부분이 clone한 프로젝트로 이해하고 넘어갔는데 아닌가요?? -
저 부분 포트를 지정해줄 필요가 있나요? main.py에서 지정해주기 때문에 main 위치만 지정해주면 되는 거 아닌가요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 상태코드를 나누는 이유는 각각의 역할과 책임을 분리하고 관리 용이성, 프론트와 명확한 소통 때문이 나눈 것 입니다.
- 이해하지 못했습니다..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분은 라우터 pr과 합쳐지면 바뀌어야합니다.
dfa9f45 to
d059b53
Compare
common response 생성 및 테스트 router 생성