用户工具

站点工具


文章接口

到此差别页面的链接

两侧同时换到之前的修订记录 前一修订版
后一修订版
前一修订版
文章接口 [2016/12/21 16:45]
lyy
文章接口 [2017/06/01 13:59] (当前版本)
行 53: 行 53:
 |code |int |错误代码| |code |int |错误代码|
  
 +===== 2、文章操作 =====
 +
 +
 +=== 接口名称 ===
 + /​admin/​article/​operate
 +=== 请求方式 ===
 +  post
 +=== 请求参数 ===
 +^ 参数名称 ​     ^ 参数类型 ​   ^ 是否必填 ​ ^ 说明 ​     ^
 +|id|int|否|编辑的时候必填|
 +|type|string|是|create(添加) , update(更新)|
 +|title|string|是|标题|
 +|adminid|intval|是|后台发布文章者id|
 +|content|string|是|文章内容|
 +|site_id|array|是|所属站点|
 +|category_id|array|是|所属站点下的栏目|
 +|thumb|string|否|缩略图|
 +|keywords|string|否|关键字|
 +|description|string|否|文章描述|
 +|copyfrom|string|否|文章作者|
 +|fromlink|string|否|文章来源|
 +|list_order|int |否|文章排序 (默认99)|
 +|status|int |否|文章状态 0锁定 1正常 (默认1)|
 +|recommend|int |否|文章推荐状态 0未推荐 1推荐 (默认1)|
 +=== 返回值 ===
 +^ 名称 ​      ^ 类型 ​   ^ 说明 ​                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ^
 +|ret |int |获取数据状态 1:成功 0:失败|
 +|retMsg |string |操作|
 +|code |int |错误代码|
 +===== 3、获取文章详情 =====
 +
 +
 +=== 接口名称 ===
 + /​admin/​article/​view
 +=== 请求方式 ===
 +  post
 +=== 请求参数 ===
 +^ 参数名称 ​     ^ 参数类型 ​   ^ 是否必填 ​ ^ 说明 ​     ^
 +|id|int|是|文章id|
 +
 +=== 返回值 ===
 +^ 名称 ​      ^ 类型 ​   ^ 说明 ​                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ^
 +|ret |int |获取数据状态 1:成功 0:失败|
 +|retData |josn |文章信息列表<​code>​
 +[
 +{" id":"​1",//​文章id
 +" title ":"​ 新闻",//​文章标题
 +" keywords ":"​哈哈",//​文章关键词
 +"​admin_id"​ :"​2",​后台发布文章者id
 +" description ":"​1",//​文章描述
 +" copyfrom":"​ 新闻",//​文章作者
 +" fromlink":"",//​文章链接
 +" thumb":"​1",//​文章缩略图
 +" tags":"​news",//​文章标签
 +" hits":"​1",//​文章浏览量
 +" createtime":"​2015-9-18 :9:​00:​00",//​文章添加时间
 +" updatetime":"​2015-9-18 :9:​00:​00",//​文章更新时间
 +" list_order":"​99",//​文章排序
 +" status":"",//​文章状态 0锁定 1正常
 +" recommend ":"",//​文章推荐状态 0未推荐 1推荐
 +}
 +]
 +
 +</​code>​|
 +|code |int |错误代码|
 +
 +===== 4、文章删除 =====
 +
 +
 +=== 接口名称 ===
 + /​admin/​article/​delete
 +=== 请求方式 ===
 +  post
 +=== 请求参数 ===
 +^ 参数名称 ​     ^ 参数类型 ​   ^ 是否必填 ​ ^ 说明 ​     ^
 +|id|int|是|文章id|
 +
 +=== 返回值 ===
 +^ 名称 ​      ^ 类型 ​   ^ 说明 ​                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ^
 +|ret |int |获取数据状态 1:成功 0:失败|
 +|retMsg |string |操作|
 +|code |int |错误代码|
 +
 +
 +===== 5、文章状态 =====
 +
 +
 +=== 接口名称 ===
 + /​admin/​article/​status
 +=== 请求方式 ===
 +  post
 +=== 请求参数 ===
 +^ 参数名称 ​     ^ 参数类型 ​   ^ 是否必填 ​ ^ 说明 ​     ^
 +|id|int|是|文章id|
 +|type|string|是|start(开启) , stop(停用)|
 +=== 返回值 ===
 +^ 名称 ​      ^ 类型 ​   ^ 说明 ​                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ^
 +|ret |int |获取数据状态 1:成功 0:失败|
 +|retMsg |string |操作|
 +|code |int |错误代码|
 +
 +===== 6、文章推荐 =====
 +
 +
 +=== 接口名称 ===
 + /​admin/​article/​recommend
 +=== 请求方式 ===
 +  post
 +=== 请求参数 ===
 +^ 参数名称 ​     ^ 参数类型 ​   ^ 是否必填 ​ ^ 说明 ​     ^
 +|id|int|是|文章id|
 +|type|string|是|start(推荐) , stop(取消推荐)|
 +=== 返回值 ===
 +^ 名称 ​      ^ 类型 ​   ^ 说明 ​                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ^
 +|ret |int |获取数据状态 1:成功 0:失败|
 +|retMsg |string |操作|
 +|code |int |错误代码|
文章接口.1482309926.txt.gz · 最后更改: 2017/06/01 13:58 (外部编辑)