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

[#109] 활동 추천 API 구축 #113

Merged
merged 9 commits into from
May 30, 2024
Merged

[#109] 활동 추천 API 구축 #113

merged 9 commits into from
May 30, 2024

Conversation

yel-m
Copy link
Member

@yel-m yel-m commented May 30, 2024

#️⃣ 연관된 이슈

Resolves #109

📝 작업 내용

이번 PR에서 작업한 내용을 간략히 설명해주세요 (이미지 첨부 가능)

브랜치명을 #110으로 잘못 설정한 것은.. 흐린 눈 부탁드림니다 >.<

주요 변경 사항

  • 오늘 행복도가 높았던 활동을 추천하는 API를 작성했습니다.
  • 추천 시 행복도가 5 이상인 활동을 랜덤으로 추천하도록 구현했습니다.
  • 로그인한 유저의 기록을 제외한 데이터 내에서 추천하도록 구현했습니다.

api/trend/recommend로 GET 요청 시 다음과 같은 응답을 받을 수 있습니다.

  • 3개 이하일 때 (null 값 처리를 하지 않도록 데이터를 채워두기로 했지만, 혹시 몰라 데이터가 3개 이하일 때 null 값을 넣어 보내주도록 구현했습니다.)

    {
      "success": true,
      "code": 0,
      "message": "오늘의 인기 활동을 성공적으로 조회했습니다.",
      "data": [
        {
          "name": "카페 가기",
          "emoji": "☕️"
        },
        {
          "name": null,
          "emoji": null
        },
        {
          "name": null,
          "emoji": null
        }
      ]
    }
  • 3개 이상일 때

    {
      "success": true,
      "code": 0,
      "message": "오늘의 인기 활동을 성공적으로 조회했습니다.",
      "data": [
        {
          "name": "계획 세우기",
          "emoji": "🧭"
        },
        {
          "name": "카페 가기",
          "emoji": "☕️"
        },
        {
          "name": "쇼핑하기",
          "emoji": "🛍️"
        }
      ]
    }

사소한 변경 사항

  • User 도메인의 API에 대하여 스웨거 설명을 추가했습니다.
  • ResponseDto 이름을 통일했습니다.
    • ActivityHappinessDto -> ActivityHappinessResponseDto 와 같이 Response 키워드가 필요할 것 같은 DTO는 일관성을 위해 넣어주었습니다.
    • getHappiness, getPopular 다른 메서드명과 통일하여 getHappinessActivities와 getPopularActivities로 변경했습니다.
    • TrendPopularActivitiesResponseDto는 활동 하나에 대한 DTO이므로 TrendPopularActivitiyResponseDto로 변경했습니다!

리팩토링 기준이 주관적입니다!! 언제든 다른 의견이 있다면 마구마구 코멘트 남겨주시와요!!

스크린샷 (선택)

💬 리뷰 요구사항(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

✅ Check List

  • PR 제목을 커밋 규칙에 맞게 작성했는가?
  • PR에 해당되는 Issue를 연결했는가?
  • 적절한 라벨을 설정했는가?
  • 작업한 사람을 모두 Assign했는가?

@yel-m yel-m requested a review from KkomSang May 30, 2024 07:48
@yel-m yel-m self-assigned this May 30, 2024
@yel-m yel-m changed the title [#110] 활동 추천 API 구축 [#109] 활동 추천 API 구축 May 30, 2024
Copy link
Collaborator

@KkomSang KkomSang left a comment

Choose a reason for hiding this comment

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

덕분에 코드가 더 멋있어졌네용~~~~~~~~😉

@yel-m yel-m added the feat 새로운 기능을 추가합니다 label May 30, 2024
@KkomSang KkomSang merged commit 378c220 into develop May 30, 2024
@KkomSang KkomSang deleted the feat/#110 branch May 30, 2024 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat 새로운 기능을 추가합니다
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants