💡
채널 & Post
1. 채널 목록[GET]
→ 채널 목록을 불러옵니다.
Request
Response
2. 특정 채널 정보[GET]
Request
Response
3. 특정 채널의 포스트 목록[GET]
필요한 프로퍼티만 두고 다 빼자
🌷
/posts/channels/{channelId}
Request
Response
4. 특정 채널에 포스트 작성하기[POST]
Request
Response
5. 특정 포스트 상세 보기[POST] ← GET인거 같은데.. // GET이 맞다고 합니당
Request
Response
6. 포스트 수정하기[PUT]
Request
Response
7. 포스트 삭제하기[DELETE]
Request
Response
8. 포스트(사용자도 함께) 검색[GET]
흠. 이 API는 포스트 검색만으로 사용해도 될 듯합니다.
Request
Response
[ // Channel Array
{
authRequired: Boolean, // 사용되지 않는다고 했는데 인증채널할 때 필요하지 않남.
posts: String[],
_id: String,
name: String,
description: String,
createdAt: String,
updateAt: String
}
]
{ // Channel
authRequired: Boolean, // 사용되지 않는다고 했는데 인증채널할 때 필요하지 않남.
posts: String[],
_id: String,
name: String,
description: String,
createdAt: String,
updateAt: String
}
{ // params
offset: Number, // option
limit: Number // option
}
[ // Post Array
{
"likes": [
{
"_id": String,
"user": String, // 사용자 id
"post": String, // 포스트 id
"createdAt": String,
"updatedAt": String
}
],
"comments": [
{
"_id": String,
"comment": String,
"author": User,
"post": String, // 포스트 id
"createdAt": String,
"updatedAt": String
}
],
"_id": String,
"image": Optional<String>,
"imagePublicId": Optional<String>,
"title": String,
"channel": {
"authRequired": Boolean, // 사용되지 않음
"posts": String[],
"_id": String,
"name": String,
"description": String,
"createdAt": String,
"updatedAt": String
},
"author": {
"coverImage": String, // 커버 이미지
"image": String, // 프로필 이미지
"role": String,
"isOnline": Boolean,
"posts": Post[],
"likes": [
{
"_id": String,
"user": String, // 사용자 id
"follower": String, // 사용자 id
"createdAt": String,
"updatedAt": String
}
],
"comments": String[],
"followers": [
{
"_id": String,
"user": String, // 사용자 id
"follower": String, // 사용자 id
"createdAt": String,
"updatedAt": String
}
],
"following": [
{
"_id": String,
"user": String, // 사용자 id
"follower": String, // 사용자 id
"createdAt": String,
"updatedAt": String
}
],
"notifications": Notification[],
"messages": Message[],
"_id": String,
"fullName": String,
"email": String,
"createdAt": String,
"updatedAt": String
},
"createdAt": String,
"updatedAt": String
}
]
{
header: {
Authorization: 'bearer JWT token'
},
body: {
title: String,
image: Binary | null,
channelId: String
}
}
{ // Post Object
"likes": Like[],
"comments": Comment[],
"_id": String,
"image": Optional<String>,
"imagePublicId": Optional<String>,
"title": String,
"channel": Channel,
"author": User,
"createdAt": String,
"updatedAt": String
}
{
header: {
Authorization: 'bearer JWT token'
},
body: {
postId: String,
title: String,
image: Binary | null,
imageToDeletePulicId: String, // option -> 이미지 삭제 시 imagePublicId
channelId: String
}
}
{
header: {
Authorization: 'bearer JWT token'
},
body: {
id: String
}
}
// (User | Post)[]
{
"likes": Like[],
"comments": Comment[],
"_id": String,
"image": Optional<String>,
"imagePublicId": Optional<String>,
"title": String,
"channel": Channel,
"author": User,
"createdAt": String,
"updatedAt": String
}