Descriptions
Method
URI
FE
BE
게시물 작성
POST
/api/posts
박준수
조권영
이미지 업데이트
PUT
/api/posts/:postId/image
박준수
조권영
게시물 전체 조회
GET
/api/posts/?userId&keyword&sort&type&gender&page&count&order
박준수,신수정
조권영
게시물 상세 조회
GET
/api/posts/detail/:postId
박준수
황수민
게시물 수정
PUT
/api/posts/:postId
박준수
조권영
게시물 삭제
DELETE
/api/posts/:postId
박준수
조권영
대표 게시물 지정
PATCH
/api/posts/:postId
박준수
조권영
대표 게시물 조회
GET
/api/posts/rep?userId
박준수
황수민
인기 게시물 조회
GET
/api/posts/popular
박준수
황수민
명예의 전당 조회
GET
/api/posts/honor?page&count
신수정
황수민
{
post : {
title : "제목" ,
content : "내용" ,
} ,
items : [
{
imgUrl : "http :/ / abc" ,
brand : "나이키" ,
name : "가나다 운동화" ,
price : "79000원" ,
url : "http :/ / abc"
} * 여러 개
]
}
{
status : 201 ,
msg : "게시물 작성 성공" ,
data :{
post : {
postId : 1 ,
title : "제목" ,
content : "내용" ,
imgUrl : "http :/ / abc" ,
} ,
items : [
{
imgUrl : "http :/ / abc" ,
brand : "나이키" ,
name : "가나다 운동화" ,
price : "79000원" ,
url : "http :/ / abc" 또는 null
} * 여러 개
]
}
}
이미지 업데이트 PUT/api/posts/:postId/image
{
status : 201 ,
msg : "게시물 작성 성공" ,
data :{
post : {
postId : 1 ,
title : "제목" ,
content : "내용" ,
imgUrl : "http :/ / abc" ,
} ,
items : [
{
imgUrl : "http :/ / abc" ,
brand : "나이키" ,
name : "가나다 운동화" ,
price : "79000원" ,
url : "http :/ / abc" 또는 null
} * 여러 개
]
}
}
게시물 전체 조회 GET/api/posts/?userId&keyword&sort&type&gender&page&count&order
< req . query >
{
"userId" : 1 또는 null
"keyword" : "가방" 또는 null
"sort" : "title" 또는 "writer" 또는 null
"type" : "my" 또는 "1(userId)" 또는 null
"gender" : "남자" 또는 "여자" 또는 null
"page" // default 1
"count" //default 8
"order" : "recent" 또는 "popular"
}
{
status : 200 ,
msg : "게시물 전체 조회 성공" ,
data : {
allPosts : [
{
postId : 1 ,
title :
content :
createdAt :
likeCount :
likeStatus :
userId :
imgUrl : "http :/ / abc" ,
} * 8
] ,
}
}
게시물 상세 조회 GET/api/posts/detail/:postId
< req . params >
{
"postId" : 1
}
{
status : 200 ,
msg : "게시물 상세 조회 성공"
data : {
post : {
userId : 1 ,
postId : 1 ,
title : "제목" ,
content : "내용" ,
imgUrl : "http :/ / abc" ,
likeCount : 10 ,
createdAt : "DateForm" ,
likeStatus : true //게시물을 좋아요 여부
} ,
items : [
{
imgUrl : "http :/ / abc" ,
brand : "나이키" ,
name : "가나다 운동화" ,
price : "79000원" ,
url : "http :/ / abc" 또는 null
} * 여러 개
] ,
} ,
}
게시물 수정 PUT/api/posts/:postId
{
post : {
title : "제목" ,
content : "내용" ,
} ,
items : [
{
imgUrl : "http :/ / abc" ,
brand : "나이키" ,
name : "가나다 운동화" ,
price : "79000원" ,
url : "http :/ / abc" ,
} * 여러 개
]
}
{
status : 200 ,
msg : "게시물 수정 성공"
data : {
post : {
userId : 1 ,
postId : 1 ,
title : "제목" ,
content : "내용" ,
imgUrl : "http :/ / abc" ,
likeCount : 10 ,
createdAt : "DateForm" ,
likeStatus : true //게시물을 좋아요 여부
} ,
items : [
{
imgUrl : "http :/ / abc" ,
brand : "나이키" ,
name : "가나다 운동화" ,
price : "79000원" ,
url : "http :/ / abc" 또는 null
} * 여러 개
] ,
} ,
}
게시물 삭제 DELETE/api/posts/:postId
< req . params >
{
"postId" : 1
}
{
status : 200 ,
msg : "게시물 삭제 성공" ,
data : { }
}
대표 게시물 지정 PATCH/api/posts/:postId
< req . params >
{
"postId" : 1
}
{
status : 200 ,
msg : "대표 게시물 지정 성공" ,
data : { }
}
대표 게시물 조회 GET/api/posts/rep?userId
< req . query >
{
"userId" : 1
}
{
status : 200 ,
msg : "대표 게시물 조회 성공"
data : {
myRepPost : {
postId : 1 ,
userId : 1 ,
imgUrl : "http :/ / abc" ,
title : "제목" ,
content : "내용" ,
likeCount : 10 ,
createdAt : "DateForm"
}
}
}
인기 게시물 조회 GET/api/posts/popular
{
status : 200 ,
msg :"인기 게시물 조회 성공" ,
data : {
hotPosts :[
{
postId : 1 ,
imgUrl : "http :/ / abc" ,
userId : 1 ,
delete : false
} * 3
] ,
}
}
명예의 전당 조회 GET/api/posts/honor?page&count
< req . query >
{
"page" : 1 ,
"count" : 8
}
{
status : 200 ,
msg :"명예의 전당 게시물 조회 성공" ,
data : {
honorPosts :[
{
postId : 1 ,
rank : 1 ,
title :
content :
createdAt : 게시물작성일X , hotposts 지정일
likeCount :
likeStatus :
userId :
imgUrl : "http :/ / abc" ,
} * 8
] ,
}
}