GET category:id - nomadcoder-community-clone-coding/Back-end GitHub Wiki
description: 카테고리 선택 시 해당 카테고리의 게시물 리스트 반환
Attribute Definition
attribute | data type | description |
---|---|---|
id | Long | post 고유의 id |
title | String | 제목 |
category | String | 카테고리 이름 |
categoryId | Long | 카테고리 id |
writer | String | 글쓴이 |
writerPhoto | String | 글쓴이의 프로필사진 |
createdDate | String | 생성된 지 얼마나 되었는지에 대한 정보 |
commentNum | Int | 댓글 수 |
likes | Long | 좋아요 수 |
Response Example
최신 순으로 정렬되어 있음.
http://localhost:8080/category/15 → category 15에 해당하는 글 불러오기
[
{
"id": 6,
"title": "나에게 어울리는 해리포터 주문 💫 (feat. 별이 빛나는 밤)",
"categoryId": 15,
"category": "type_test",
"writer": "jyoonsong",
"writerPhoto": "https://d1telmomo28umc.cloudfront.net/media/public/avatars/jaeeun_98-3CjM5C-avatar.jpg",
"createdDate": "23 hours ago",
"commentNum": 6,
"likes": 8
},
{
"id": 4,
"title": "나만의 반려식물 찾기 테스트 🌱",
"categoryId": 15,
"category": "type_test",
"writer": "313yang",
"writerPhoto": "https://d1telmomo28umc.cloudfront.net/media/public/avatars/jinnyk-1622538073.jpg",
"createdDate": "2 days ago",
"commentNum": 3,
"likes": 5
},
{
"id": 1,
"title": "코린이도 뚝딱! 👻 심리테스트 👻 만들기! 상품은 호캉스?!",
"categoryId": 15,
"category": "type_test",
"writer": "lynn",
"writerPhoto": "https://d1telmomo28umc.cloudfront.net/media/public/avatars/lynn-1608029862.jpg",
"createdDate": "2 weeks ago",
"commentNum": 10,
"likes": 16
}
]
// http://localhost:8080/category/1 → 전체 글 불러오기
[
{
"id": 8,
"title": "코코아톡 17기 첼린지 후기",
"categoryId": 3,
"category": "html_css",
"writer": "dmdtkrlfdn",
"writerPhoto": "https://d1telmomo28umc.cloudfront.net/media/public/avatars/applelover123123123-1621750639.jpg",
"createdDate": "1 hour ago",
"commentNum": 1,
"likes": 3
},
{
"id": 7,
"title": "코코아톡 17기 챌린지 후기!",
"categoryId": 3,
"category": "html_css",
"writer": "jywoo9",
"writerPhoto": "https://d1telmomo28umc.cloudfront.net/media/public/avatars/rinezec317-1621306743.jpg",
"createdDate": "1 hour ago",
"commentNum": 1,
"likes": 3
},
{
"id": 6,
"title": "나에게 어울리는 해리포터 주문 💫 (feat. 별이 빛나는 밤)",
"categoryId": 15,
"category": "type_test",
"writer": "jyoonsong",
"writerPhoto": "https://d1telmomo28umc.cloudfront.net/media/public/avatars/jaeeun_98-3CjM5C-avatar.jpg",
"createdDate": "23 hours ago",
"commentNum": 6,
"likes": 8
},
{
"id": 5,
"title": "코코아톡 17기 챌린지 후기",
"categoryId": 3,
"category": "html_css",
"writer": "ckh2156",
"writerPhoto": "https://d1telmomo28umc.cloudfront.net/media/public/avatars/bugod-1613647069.jpg",
"createdDate": "2 days ago",
"commentNum": 2,
"likes": 4
},
{
"id": 4,
"title": "나만의 반려식물 찾기 테스트 🌱",
"categoryId": 15,
"category": "type_test",
"writer": "313yang",
"writerPhoto": "https://d1telmomo28umc.cloudfront.net/media/public/avatars/jinnyk-1622538073.jpg",
"createdDate": "2 days ago",
"commentNum": 3,
"likes": 5
},
{
"id": 3,
"title": "플레이어 버그를 제보합니다.",
"categoryId": 5,
"category": "bla-bla",
"writer": "beliemun",
"writerPhoto": "https://d1telmomo28umc.cloudfront.net/media/public/avatars/cuqi213-1612330608.jpg",
"createdDate": "3 days ago",
"commentNum": 1,
"likes": 2
},
{
"id": 2,
"title": "CSS Master course 후기",
"categoryId": 3,
"category": "html_css",
"writer": "utillyong",
"writerPhoto": "https://d1telmomo28umc.cloudfront.net/media/public/avatars/yoonhero06-1620641794.jpg",
"createdDate": "3 days ago",
"commentNum": 0,
"likes": 0
},
{
"id": 1,
"title": "코린이도 뚝딱! 👻 심리테스트 👻 만들기! 상품은 호캉스?!",
"categoryId": 15,
"category": "type_test",
"writer": "lynn",
"writerPhoto": "https://d1telmomo28umc.cloudfront.net/media/public/avatars/lynn-1608029862.jpg",
"createdDate": "2 weeks ago",
"commentNum": 10,
"likes": 16
}
]