Skip to content

Commit a5c773e

Browse files
Update community.md
1 parent 5756d92 commit a5c773e

1 file changed

Lines changed: 81 additions & 0 deletions

File tree

src/api/v1/community.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,84 @@ GET /v1/community/comment/comment-reward
114114
"msg": "success" // 返回消息
115115
}
116116
```
117+
118+
## 点赞/取消点赞文章
119+
120+
GET /v1/community/posts/post-like
121+
122+
请求头:
123+
124+
|名称|必须|备注|
125+
|-----|-----|-----|
126+
|token|||
127+
128+
请求体:
129+
```JSONC
130+
{
131+
"id": 123, // 文章ID
132+
}
133+
```
134+
135+
响应体:
136+
```JSONC
137+
{
138+
"code": 1, // 请求状态码,1为正常
139+
"msg": "success" // 返回消息
140+
}
141+
```
142+
143+
## 收藏/取消收藏文章
144+
145+
GET /v1/community/posts/post-collect
146+
147+
请求头:
148+
149+
|名称|必须|备注|
150+
|-----|-----|-----|
151+
|token|||
152+
153+
请求体:
154+
```JSONC
155+
{
156+
"id": 123, // 文章ID
157+
}
158+
```
159+
160+
响应体:
161+
```JSONC
162+
{
163+
"code": 1, // 请求状态码,1为正常
164+
"msg": "success" // 返回消息
165+
}
166+
```
167+
168+
## 编辑收藏文章
169+
170+
GET /v1/community/posts/edit
171+
172+
请求头:
173+
174+
|名称|必须|备注|
175+
|-----|-----|-----|
176+
|token|||
177+
178+
请求体:
179+
```JSONC
180+
{
181+
"postId": 123, // 文章ID
182+
"title": "测试文章标题",
183+
"content": "测试文章内存", // 文章内容
184+
"contentType": 2 // 文章内容类别,1-文本,2-markdown
185+
}
186+
```
187+
188+
响应体:
189+
```JSONC
190+
{
191+
"code": 1, // 请求状态码,1为正常
192+
"data": {
193+
"id": 30822 // 文章ID(不知道为什么要再返回一遍)
194+
},
195+
"msg": "success" // 返回消息
196+
}
197+
```

0 commit comments

Comments
 (0)