-
Notifications
You must be signed in to change notification settings - Fork 1
API Specification
BangDori edited this page Apr 12, 2024
·
30 revisions
κΈ°λ₯ | λ©μλ | URI | λΉκ³ |
---|---|---|---|
νΌλ λͺ©λ‘ μ‘°ν | GET | /feeds | |
νΌλ μμ± | POST | /feeds | |
νΌλ μμΈ | GET | /feeds/{feed_id} | |
νΌλ μμ | PUT | /feeds/{feed_id} | |
νΌλ μμ | DELETE | /feeds/{feed_id} | |
νΌλ μ’μμ | POST | /feeds/{feed_id}/like | |
νΌλ μ κ³ | POST | /feeds/{feed_id}/report | |
νΌλ μ΄λ―Έμ§ μ λ‘λ | POST | /feeds/{feed_id}/image | β¨ λ°©λ² λ Όμ νμ (preSignedURL) |
νΌλ μ΄λ―Έμ§ μ κ±° | DELETE | /feeds/{feed_id}/image | β¨ λ°©λ² λ Όμ νμ |
- request: X
- response: Feed[]
// request
interface Request {
title: string;
content: string;
images: string[]; // νλ‘ νΈ μ
λ‘λ or μλ² μ
λ‘λ λ
Όμ νμ
scope: "public" | "friends" | "private";
}
// response: μ±κ³΅ | μ€ν¨μ λ°λ₯Έ μλ΅ μ½λ
- request: X
- response: Feed + Comment
interface Feed {
id: string | number; // id κ°μ stringμΌλ‘ μ€μ νλμ§ numberλ‘ μ€μ νλμ§?
user: {
// κ²μλ¬Όμ μμ±ν μ μ μ 보
id: string | number;
profile_image: string;
name: string;
// 1. νλ‘μ° λμλμ§μ μκΈ° κ²μλ¬ΌμΈμ§μ λν μ¬λΆλ₯Ό λ³μ νλλ‘ μ²΄νΉνλ€.
// ex)
// relationship_status: 'self' | 'following' | 'none'
// 2. κ° μνλ₯Ό λ³μλ‘ λΆλ¦¬νλ€.
// ex)
// is_follow: boolean
// is_self_feed: boolean
};
title: string;
content: string;
images: string[];
like_count: number;
comment_count: number;
is_like: boolean;
is_bookmark: boolean;
updated_at: string;
}
// request
interface Request {
title: string;
content: string;
images: string[]; // νλ‘ νΈ μ
λ‘λ or μλ² μ
λ‘λ λ
Όμ νμ
scope: "public" | "friends" | "private";
}
// response: μ±κ³΅ | μ€ν¨ μλ΅ μ½λ
// request
interface Request {
feed_id: number | string; // numberλ‘ ν μ§ stringμΌλ‘ ν μ§, μλ²μμ μ ν΄μ€μΌν¨
}
// response: μ±κ³΅ | μ€ν¨ μλ΅ μ½λ
// request
interface Request {
feed_id: number | string; // numberλ‘ ν μ§ stringμΌλ‘ ν μ§, μλ²μμ μ ν΄μ€μΌν¨
}
// response: μ±κ³΅ | μ€ν¨ μλ΅ μ½λ
// request
interface Request {
feed_id: number | string; // numberλ‘ ν μ§ stringμΌλ‘ ν μ§, μλ²μμ μ ν΄μ€μΌν¨
}
// response: μ±κ³΅ | μ€ν¨ μλ΅ μ½λ
- 보λ₯
- 보λ₯
κΈ°λ₯ | λ©μλ | URI | λΉκ³ |
---|---|---|---|
νλ‘μ° μμ² | POST | /users/{user_id}/follow | |
μ¬μ©μ κ²μ | GET | /users | |
μ¬μ©μ νλ‘ν μ‘°ν | GET | /users/{user_id} |
// request
interface Request {
user_id: number | string;
}
// response: μ±κ³΅ | μ€ν¨ μλ΅ μ½λ
μ°λ‘νλ§μΌλ‘ ν κ±°λ, λλ°μ΄μ€λ‘ ν κ±°λ, μλλ©΄ λͺ¨λ μ λ ₯μ λν΄ κ²μν κ±°λ?
// request
// μ¬μ©μ + (κ²μλ¬Ό κ²μ - νμ¬λ μμ§λ§ μΆν λ±λ‘λλ€λ©΄?)
`/search/top?q=${}`
// (κ²μλ¬Ό κ²μ - νμ¬λ μμ§λ§ μΆν λ±λ‘λλ€λ©΄)
`/search/posts?q=${}`
// μΌλ° μ¬μ©μ κ²μ
`/search/users?q=${}`
// μ’μμ μ¬μ©μ κ²γ
κ°
`/search/like?q=${}`
// response
interface Response {
users: User[]
}
// request
interface Request {
user_id: number | string;
}
// respnose
interface Response {
user: User;
feeds: Feed[];
is_follow: boolean; // νλ‘μ° μ¬λΆλ₯Ό userμ λ£λκ² λ§λμ§, μλλ©΄ λΆλ¦¬νλκ² λ§λμ§ μ 맀νλ€!
}
- β : νμΈ μλ£
β οΈ : λκΈ° μν