发布文章
POST /api/article
参数:
| 参数名 | 类型 | 是否必传 | 说明 | 示例值 |
|---|---|---|---|---|
| METHOD | String | 是 | 接口方法 | POST |
| total | array | 是 | 请求数据 | |
| total.title | string | 是 | 文章标题 | 文章标题 |
| total.keywords | string | 是 | 文章关键字 | 文章关键字 |
| total.description | string | 是 | 文章描述 | 文章描述 |
| total.author | string | 是 | 作者ID | 10000 |
| total.classify | string | 是 | 分类ID | 01 |
| total.content | string | 是 | 文章内容 | Mrkdown、html |
| total.cover | string | 是 | 文章封面 | /upload/cover/1.png |
| total.create | string | 是 | 创建时间 | 创建时间 |
| total.update | string | 是 | 更新时间 | 更新时间 |
| total.tag | array | 是 | 文章标签 | ["01","02","03"] |
请求示例:
{
"METHOD": "POST",
"total":{
"title": "文章标题",
"keywords": "左岸,LeftBank,左岸博客",
"description": "这是一段简单的描述,用于SEO",
"author": "10000",
"classify": "01",
"content": "# Hello World\n >这是一个 Markdown 文档。",
"cover": "https://img.eme.cm/102.png",
"create": "创建时间",
"update": "更新时间",
"tag": ["01","02","03"]
}
}响应示例:
{
"code":100200,
"notify":"success",
"total":{
"id": "10000"
}
}删除文章
POST /api/article
参数:
| 参数名 | 类型 | 是否必传 | 说明 | 示例值 |
|---|---|---|---|---|
| METHOD | String | 是 | 接口方法 | DELETE |
| total | array | 是 | 请求数据 | |
| total.id | string | 是 | 文章ID | 10000 |
请求示例:
{
"METHOD": "DELETE",
"total":{
"id": "10000"
}
}响应示例:
{
"code":100200,
"notify":"success",
"total":{
"id": "10000"
}
}修改文章
POST /api/article
参数:
| 参数名 | 类型 | 是否必传 | 说明 | 示例值 |
|---|---|---|---|---|
| METHOD | String | 是 | 接口方法 | PATCH |
| total | array | 是 | 请求数据 | |
| total.id | string | 是 | 文章ID | 10000 |
| total.title | string | 是 | 文章标题 | 文章标题 |
| total.keywords | string | 是 | 文章关键字 | 文章关键字 |
| total.description | string | 是 | 文章描述 | 文章描述 |
| total.author | string | 是 | 作者ID | 10000 |
| total.classify | string | 是 | 分类ID | 01 |
| total.content | string | 是 | 文章内容 | Mrkdown、html |
| total.cover | string | 是 | 文章封面 | /upload/cover/1.png |
| total.create | string | 是 | 创建时间 | 创建时间 |
| total.update | string | 是 | 更新时间 | 更新时间 |
| total.tag | array | 是 | 文章标签 | ["01","02","03"] |
请求示例
{
"METHOD": "PATCH",
"total":{
"id": "10000",
"title": "文章标题",
"keywords": "左岸,LeftBank,左岸博客",
"description": "这是一段简单的描述,用于SEO",
"author": "10000",
"classify": "01",
"content": "# Hello World\n >这是一个 Markdown 文档。",
"cover": "https://img.eme.cm/102.png",
"create": "创建时间",
"update": "更新时间",
"tag": ["01","02","03"]
}
}响应示例:
{
"code":100200,
"notify":"success",
"total":{
"id": "10000"
}
}获取所有文章
POST /api/article
参数:
| 参数名 | 类型 | 是否必传 | 说明 | 示例值 |
|---|---|---|---|---|
| METHOD | String | 是 | 接口方法 | ALL |
请求示例:
{
"METHOD": "ALL"
}响应示例:
{
"code":100200,
"notify":"success",
"total":[
{
"id": "10000",
"title": "文章标题",
"keywords": "左岸,LeftBank,左岸博客",
"description": "这是一段简单的描述,用于SEO",
"author": "10000",
"classify": "01",
"content": "# Hello World\n >这是一个 Markdown 文档。",
"cover": "https://img.eme.cm/102.png",
"create": "创建时间",
"update": "更新时间",
"tag": ["01","02","03"]
},
{
"id": "10001",
"title": "文章标题",
"keywords": "左岸,LeftBank,左岸博客",
"description": "这是一段简单的描述,用于SEO",
"author": "10000",
"classify": "01",
"content": "# Hello World\n >这是一个 Markdown 文档。",
"cover": "https://img.eme.cm/102.png",
"create": "创建时间",
"update": "更新时间",
"tag": ["01","02","03"]
},
{
"id": "10002",
"title": "文章标题",
"keywords": "左岸,LeftBank,左岸博客",
"description": "这是一段简单的描述,用于SEO",
"author": "10000",
"classify": "01",
"content": "# Hello World\n >这是一个 Markdown 文档。",
"cover": "https://img.eme.cm/102.png",
"create": "创建时间",
"update": "更新时间",
"tag": ["01","02","03"]
}
]
}分页查询文章
POST /api/article
参数:
| 参数名 | 类型 | 是否必传 | 说明 | 示例值 |
|---|---|---|---|---|
| METHOD | String | 是 | 接口方法 | PAGE |
| total | array | 是 | 请求数据 | |
| total.page | string | 是 | 当前页码 | 1 |
| total.number | string | 是 | 每页数量 | 10 |
请求示例:
{
"METHOD": "PAGE",
"total":{
"page": "1",
"number": "10"
}
}响应示例:
{
"code":100200,
"notify":"success",
"total":{
"pagination": "1",
"count": "100",
"article":[
{
"id": "10000",
"title": "文章标题",
"keywords": "左岸,LeftBank,左岸博客",
"description": "这是一段简单的描述,用于SEO",
"author": "10000",
"classify": "01",
"content": "# Hello World\n >这是一个 Markdown 文档。",
"cover": "https://img.eme.cm/102.png",
"create": "创建时间",
"update": "更新时间",
"tag": ["01","02","03"]
},
{
"id": "10001",
"title": "文章标题",
"keywords": "左岸,LeftBank,左岸博客",
"description": "这是一段简单的描述,用于SEO",
"author": "10000",
"classify": "01",
"content": "# Hello World\n >这是一个 Markdown 文档。",
"cover": "https://img.eme.cm/102.png",
"create": "创建时间",
"update": "更新时间",
"tag": ["01","02","03"]
},
{
"id": "10002",
"title": "文章标题",
"keywords": "左岸,LeftBank,左岸博客",
"description": "这是一段简单的描述,用于SEO",
"author": "10000",
"classify": "01",
"content": "# Hello World\n >这是一个 Markdown 文档。",
"cover": "https://img.eme.cm/102.png",
"create": "创建时间",
"update": "更新时间",
"tag": ["01","02","03"]
}
]
}
}查询文章详情
POST /api/article
参数:
| 参数名 | 类型 | 是否必传 | 说明 | 示例值 |
|---|---|---|---|---|
| METHOD | String | 是 | 接口方法 | DETAIL |
| total | array | 是 | 请求数据 | |
| total.type | string | 是 | 返回类型 | Markdown、html |
| total.id | string | 是 | 文章ID | 10000 |
请求示例:
{
"METHOD": "DETAIL",
"total":{
"type": "html",
"id": "10000"
}
}响应示例:
{
"code":100200,
"notify":"success",
"total":{
"id": "10000",
"title": "文章标题",
"keywords": "左岸,LeftBank,左岸博客",
"description": "这是一段简单的描述,用于SEO",
"author": "10000",
"classify": "01",
"content": "<h1>Hello World</h1><p>这是一个 Markdown 文档。</p>",
"cover": "https://img.eme.cm/102.png",
"create": "创建时间",
"update": "更新时间",
"tag": ["01","02","03"]
}
}
评论