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] 마이페이지 족보 리스트 API #58

Merged
merged 6 commits into from
Jul 14, 2024
Merged

Conversation

PicturePark1101
Copy link
Contributor

@PicturePark1101 PicturePark1101 commented Jul 12, 2024

Related Issue 📌

close #51

Description ✔️

  • 마이페이지의 족보 리스트 API입니다
  • 최근 생성순으로 내림차순 정렬하여 출력했습니다.

To Reviewers

Hibernate: 
    select
        f1_0.favorite_id,
        f1_0.created_at,
        f1_0.detail,
        f1_0.image_url,
        f1_0.name,
        f1_0.updated_at,
        f1_0.user_id 
    from
        favorite f1_0 
    where
        f1_0.user_id=? 
    order by
        f1_0.created_at desc

응답값

{
    "code": 200,
    "message": "요청이 성공했습니다(200).",
    "data": {
        "favorites": [
            {
                "id": 11,
                "title": "안안안안안안안안안안안안안안안안안",
                "imageUrl": "default.com"
            },
            {
                "id": 10,
                "title": "안안안안안안안안안안안안안안안안안",
                "imageUrl": "default.com"
            },
            {
                "id": 9,
                "title": "안안안안안안안안안안안안안안안안안",
                "imageUrl": "default.comㅇ"
            }
        ]
    }
}

@PicturePark1101 PicturePark1101 self-assigned this Jul 12, 2024
@PicturePark1101 PicturePark1101 force-pushed the feat/51 branch 2 times, most recently from 9e6ed0c to 13bac2f Compare July 13, 2024 05:05
Comment on lines 18 to 20

@Query("select f from Favorite f where f.user.id = :userId order by f.createdAt desc")
List<Favorite> findAllByUserId(@Param("userId") Long userId);
Copy link
Contributor

Choose a reason for hiding this comment

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

메소드명만으로 만들 수 있는 쿼리여서 굳이 @query사용 안 하셔도 될 것 같습니다.

@PicturePark1101 PicturePark1101 merged commit e397810 into develop Jul 14, 2024
1 check passed
@PicturePark1101 PicturePark1101 deleted the feat/51 branch July 14, 2024 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] 사용자 족보 목록 - 마이페이지
2 participants