-
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
Feat/21 레시피 리스트 조회 기능 구현 #28
Conversation
…해서 전송하도록 코드 수정 # 21
return recipes | ||
|
||
|
||
def get_ingredients_list_by_recipes(recipes: Recipes) -> List[Recipes]: |
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.
이 부분 List[Ingredients]로 수정해야합니다
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.
많은 기능 구현하느라 고생하셨습니다 👍 👍
|
||
@recipes_router.get( | ||
"/users/{user_id}/recipes/cooked", | ||
response_description="유저가 요리한 레시피 목록" |
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.
description 👍
recipes = get_recipes_by_recipes_id(user_cooked_recipes_id) | ||
# 레시피로 Ingredients 리스트 조회 | ||
ingredients_list = get_ingredients_list_by_recipes(recipes) | ||
return GetRecipesReponseList(recipes, ingredients_list) |
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.
LGTM 💯
# 레시피로 Ingredients 리스트 조회 | ||
ingredients_list = get_ingredients_list_by_recipes(recipes) | ||
# 유저가 요리한 요리 표시를 위한 user_cooked_recipes_id 함께 넘기기 | ||
return GetRecipesReponseList(recipes, ingredients_list, user_cooked_recipes_id) |
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.
LGTM 💯
|
||
|
||
class GetRecipesReponse(BaseModel): | ||
id: PyObjectId |
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.
PyObjectId 를 따로 정의해 mongodb Object_id와 동일한 개념을 만든게 좋습니다
class GetRecipesReponseList: | ||
recipe_list: List[GetRecipesReponse] | ||
cooked_recipes_id: List[str] | ||
next_page_url: str |
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.
Response 별도 정의 좋습니다 👍
recipe_url: str | ||
portion: str | ||
recipe_img_url: str | ||
model_config = ConfigDict( |
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.
👍
populate_by_name=True, | ||
arbitrary_types_allowed=True, | ||
json_schema_extra={ | ||
"example": { |
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.
NoSQL의 스키마를 문서화 할 수 있는 방법을 찾아 연결하면 좋을 것 같습니다
Overview
Change Log
To Reviewer
Issue Tags