Skip to content

Latest commit

 

History

History
205 lines (181 loc) · 4.92 KB

blog.md

File metadata and controls

205 lines (181 loc) · 4.92 KB

博客 API

列出所有文章

请求 GET /api/blog/userBlogs
参数 { user?: number; page?: number }
响应主体 application/json ({ blogs: List<BlogSummary> })

列出未隐藏的文章

请求 GET /api/blog/lists
参数 BlogListParams
响应主体 application/json ({ status: number; data: List<Blog> })

获取文章

请求 GET /api/blog/detail/:id
响应主体 application/json ({ status: number; data: List<LegacyBlog> })

创建文章

请求 POST /blogAdmin/article/post_new
请求主体 application/x-www-form-urlencoded (EditBlogRequest)
响应主体 application/json ({ status: number; data: number })

编辑文章

请求 POST /blogAdmin/article/post_edit/:id
请求主体 application/x-www-form-urlencoded (EditBlogRequest)
响应主体 application/json ({ status: number; data: number })

删除文章

请求 POST /api/blog/delete/:id
响应主体 application/json ({ status: number })

批量更新文章状态

请求 POST /blogAdmin/article/list
参数 { pageType: "list" }
请求主体 application/x-www-form-urlencoded ({ method: "update"; "blog-id": number[]; "edit-status": number; "csrf-token": string })
响应主体 text/html

批量恢复/删除回收站中的文章

请求 POST /blogAdmin/article/list
参数 { pageType: "trash" }
请求主体 application/x-www-form-urlencoded ({ method: "recover" | "delete"; "blog-id": number[]; "csrf-token": string })
响应主体 text/html

获取评论

请求 GET /api/blog/replies/:id
参数 { page?: number }
响应主体 application/json ({ status: number; data: List<Comment> })

发表评论

请求 POST /api/blog/reply/:id
请求主体 application/json ({ content: string })
响应主体 application/json ({ status: number; reply: Comment })

赞/踩文章

请求 POST /api/blog/vote/:id
请求主体 application/json ({ Type: number })
响应主体 application/json ({ status: number; data: number })

删除评论

请求 POST /blogAdmin/article/deleteComment/:id
请求主体 application/x-www-form-urlencoded ({ "reply-id": number; "csrf-token": string })
响应主体 application/json ({ status: number; data: string })