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

Feat/21 레시피 리스트 조회 기능 구현 #28

Merged
merged 19 commits into from
Mar 15, 2024

Conversation

sangwoonoel
Copy link
Contributor

@sangwoonoel sangwoonoel commented Mar 14, 2024

Overview

  • 유저가 요리한 레시피 리스트를 조회하는 기능을 구현했습니다.
  • 유저가 추천 받은 레시피 리스트를 조회하는 기능을 구현했습니다.

Change Log

To Reviewer

  • poetry에 pymongo를 추가했습니다.

Issue Tags

@sangwoonoel sangwoonoel requested a review from GangBean March 14, 2024 09:47
@sangwoonoel sangwoonoel self-assigned this Mar 14, 2024
return recipes


def get_ingredients_list_by_recipes(recipes: Recipes) -> List[Recipes]:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분 List[Ingredients]로 수정해야합니다

Copy link
Contributor

@GangBean GangBean left a 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="유저가 요리한 레시피 목록"
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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(
Copy link
Contributor

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": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NoSQL의 스키마를 문서화 할 수 있는 방법을 찾아 연결하면 좋을 것 같습니다

@GangBean GangBean merged commit ff24458 into main Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants