请求方法: POST
请求路径: /articles/add
请求参数:
content: 文章内容 (必填, 类型: string)creator_name: 创建人名称 (必填, 类型: string)creator_id: 创建人 ID (可选, 类型: string)article_type: 文章类型 (可选, 类型: string)update_history: 更新历史 (可选, 类型: JSON)响应参数:
code: 状态码 (类型: number)message: 描述信息 (类型: string)data: 数据对象 (类型: object)id: 文章 ID (类型: number)示例请求:
{
"content": "This is the content of the article.",
"creator_name": "John Doe",
"creator_id": "user123",
"article_type": "tutorial"
}
示例响应:
{
"code": 200,
"message": "文章创建成功",
"data": {
"id": 1
}
}
/articles/list{
"pageSize": 10,
"pageNum": 1
}
{
"code": 200,
"message": "获取成功",
"data": {
"list": [
{
"id": 1,
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"created_at": "2023-10-01 12:00:00",
"creator_name": "John Doe",
"creator_id": "user123",
"article_type": "tutorial",
"content": "This is the content of the article.",
"update_history": [],
"views_count": 0,
"likes_count": 0,
"comments_count": 0,
"view_times": null,
"backup_field_1": null,
"backup_field_2": null,
"backup_field_3": null,
"is_deleted": 0,
"delete_status": "not_deleted",
"type": "tutorial",
"creator_ip": "::ffff:127.0.0.1",
"updated_at": null,
"updated_ip": null,
"updater_ip": null,
"updater_name": null,
"title": "定位元素的几种区分"
}
],
"total": 1,
"pageNum": 1,
"pageSize": 10
}
}
/articles/:ids{
"ids": 1,
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"type": "tutorial"
}
{
"code": 200,
"message": "获取成功",
"data": {
"id": 1,
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"created_at": "2023-10-01 12:00:00",
"creator_name": "John Doe",
"creator_id": "user123",
"article_type": "tutorial",
"content": "This is the content of the article.",
"update_history": [],
"views_count": 0,
"likes_count": 0,
"comments_count": 0,
"view_times": null,
"backup_field_1": null,
"backup_field_2": null,
"backup_field_3": null,
"is_deleted": 0,
"delete_status": "not_deleted",
"type": "tutorial",
"creator_ip": "::ffff:127.0.0.1",
"updated_at": null,
"updated_ip": null,
"updater_ip": null,
"updater_name": null,
"title": "定位元素的几种区分"
}
}
/articles/:id{
"id": 1,
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"type": "tutorial",
"content": "Updated content of the article.",
"creator_name": "John Doe",
"creator_id": "user123",
"article_type": "tutorial"
}
{
"code": 200,
"message": "文章更新成功"
}
/articles/:id{
"id": 1
}
{
"code": 200,
"message": "文章删除成功"
}