东阳市市场监督管理局副书记
摘要:■现场 今天,有东阳读者向本报发来微信爆料:东阳市市场监督管理局副书记、副局长兼市食安办专职副主任包某在上班时间到饮用水源保护地浪坑口水库裸泳,3月23日下午被东阳市纪委在现场抓了个正着。
古生村依山傍水,有上千年历史。总书记来到村民李德昌家。房子雕梁画栋,院落干净整洁,植物生机勃勃,看到一家七口“四代同堂”,他十分高兴。总书记说:“这里环境整洁,又保持着古朴形态,这样的庭院比西式洋房好。
-
在乌鲁木齐西山路西泉街某小区在建工地向北300米的山坡上,有一个不规则圆形的洞口,洞口直径约150厘米,深不见底,泛着通透红光,热浪滚滚。经测定,洞口温度高达792℃!煤炭地质勘测人员判定,这是地下煤层自燃形成的坍塌坑口。
http://upload.cmstop.net/2015/0408/1428475909901.jpg img/water1.png -
环顾洞口,直径约有80厘米,呈喇叭状。顺着洞口10厘米左右的截面向下看,有着无法猜测的深度和广度,全是通透的红色,目及最深处还散发着金色的光芒。
http://upload.cmstop.net/2015/0408/thumb_630_420_1428475910465.png img/water1.png -
在离洞口1米的范围内,热浪扑面而来,让人睁不开眼。靠近洞口5秒,脸和手背都有轻微的刺痛。
http://upload.cmstop.net/2015/0408/thumb_630_420_1428475910250.jpg img/water1.png -
西山路消防中队接警后赶到现场,中队指导员蒋东伟表示这可能是地下煤层的自燃现象,消防方面目前无法扑灭。
http://upload.cmstop.net/2015/0408/thumb_630_420_1428475911418.jpg img/water1.png -
小“火山口”。
http://upload.cmstop.net/2015/0408/1428475911871.jpg img/water1.png -
红外拍摄的小“火山口”。
http://upload.cmstop.net/2015/0408/thumb_630_420_1428475912594.jpg img/water1.png
CmsTop开放接口指南
V1.0
|
[ ] 草稿 |
文档标识 |
|
|
当前版本 |
V1.0 |
|
|
修改日期 |
2012-09-14 |
北京思拓合众科技有限公司
目录
一 开放接口说明
CmsTop开放接口是基于CmsTop系统提供的一系列数据接口集合,是CmsTop开放的体现。通过开放接口可以对CmsTop系统的基础资源(栏目,页面,区块,内容)进行读取、发布等操作,开放接口使得第三方系统快速接入成为可能。现在任意第三方系统,如团购系统、电子商务系统、论坛等均可以根据CmsTop开放平台说明开发相应的应用,快速安全的获取CmsTop系统中的信息。
二 数据规范说明
开放接口使用HTTP协议进行数据通信;
客户端使用GET或POST方式发送请求;
服务器端使用JSON格式返回数据;
通过AUTH_KEY(公钥)和AUTH_SECRET(私钥)标示用户和完成数据签名验证;
所有接口权限均在服务端进行配置开放;
所有可读取的数据均在服务端进行授权开放;
每一个接口地址中都必须指定APP,CONTROLLER和ACTION;
每一次请求都必须对请求数据进行签名,哪怕请求中没有实际参数;
每一次请求都必须以GET方式传递key(公钥)和sign(签名)参数;
2.1 
数据交互流程
2.2 错误信息规范
服务端返回的数据总是包含state字段。
当state值为true时接口调用成功,返回类似如下结构数据:
{
"state": true,
"message": "this is the success message",
"data": { }
}
其中message为成功提示信息,data为数据,不同接口返回的具体数据不同,请以接口返回数据为准,这里仅做示例说明。
当state值为false时接口调用失败,返回如下结构数据:
{
"state": false,
"error": "this is the error message"
}
其中error属性为错误信息。
发生错误时的返回格式总是如此,请从error中获取具体的错误。
三 授权验证说明
为了保障数据的安全性和一致性,CmsTop接口中要求每次请求都要对数据进行签名。
AUTH_KEY(公钥)和AUTH_SECRET(私钥)可在CmsTop系统中-扩展管理-接口授权管理 中配置获得。
3.1 数据签名流程
1. 获得GET参数,形成数组;
2. 获得POST参数,加入数组,如果已经存在相同键名的值,覆盖;
3. 过滤非实际数据参数(app,controller,action,key,sign);
4. 对参数数组按键名排序;
5. http_build_query数组形成GET形式的字符串,既使数组为空,也要进行此步骤;
6. 附加加AUTH_SECRET,形式新的字符串;
7. 进行MD5计算,获取的32位值即为SIGN签名的值
在发送请求时需要将AUTH_KEY和刚才计算的数据签名SIGN附加在请求地址上,以GET参数传递,一个典型的API请求地址构造处理(PHP代码):
<?php
$gateway = 'http://api.cmstop.dev/';
$auth_key = '84d63a7cb4af3245b64af91e9259cd6a';
$auth_secret = '0042a0c3e010d812773036662d8792de';
$api_url = '?app=system&controller=index&action=index';
$get = array();
$post = array();
$params = array_merge($get, $post);
ksort($params);
$sign = http_build_query($params);
$sign .= $auth_secret;
$sign = md5($sign);
$request_url = $gateway . $api_url . '&key=' .$auth_key . '&sign=' .$sign;
//发送请求...
?>
注:该示例接口为测试接口,其中 http://api.cmstop.dev是本文档书为书写方便引入的虚拟接口域名,工作中请以实际地址和参数值为准。
四 API接口说明
声明:
1. 以下接口中以<gateway>代替接口域名地址 http://api.cmstop.dev/进行书写;
2. 返回数据均指请求成功时返回的正常数据,请求出错时请参考“错误信息规范”;
4.1 测试接口
系统中提供了一个接口用于测试,该接口不解析任何参数,流程验证成功时返回成功,否则返回相应的错误。
接口地址:<gateway>?app=system&controller=index&action=index
接受参数:无
返回数据:
{
"state":true,
"message":"工作正常"
}
验证失败时,返回相应的错误。
4.2 栏目接口
栏目接口中仅提供了一个接口用于读取栏目结构数据,每次输出catid直属子级分类,不递归输出。如要读取所有分类,须逐级传递catid读取每个栏目的子分类,形成完整的栏目树。
注:CmsTop中的栏目树即是如此工作的,点击每个栏目逐级加载列出。
4.2.1 读取栏目列表
接口地址:<gateway>?app=system&controller=category&action=ls
接受参数:
|
参数 |
名称 |
传递类型 |
值类型 |
备注 |
|
catid |
栏目编号 |
GET |
整型 |
传递时读取该栏目的下级栏目, 不传递时读取所有的一级栏目 |
返回数据:
{
"state": true,
"data": [{
"catid": "1",
"name": "\u660e\u661f",
"url":"http:\/\/www.cmstop.dev\/t1\/",
"hasChildren":true
}, {
"catid": "2",
"name": "\u7535\u5f71",
"url":"http:\/\/www.cmstop.dev\/t2\/",
"hasChildren":false
}]
}
其中state值为true表示成功返回数据。所有接口一样,下面不再介绍。
返回字段说明:
|
参数 |
名称 |
备注 |
|
catid |
栏目编号 |
|
|
name |
栏目名称 |
|
|
url |
栏目网址 |
可选,没有为空 |
|
hasChildren |
是否有子栏目 |
用于树形加载时的判断,布尔值 |
4.3 页面接口
页面接口一共提供了4个,分别用于读取页面列表,读取页面的区块列表,读取区块的内容和区块的HTML。
4.3.1 读取页面列表
接口地址:<gateway>?app=page&controller=page&action=ls
接受参数:
|
参数 |
名称 |
传递类型 |
值类型 |
备注 |
|
pageid |
页面编号 |
GET |
整型 |
传递时读取该页面的授权子级页面, 不传递时读取所有授权的一级页面 |
返回数据:
{
"state": true,
"data": [{
"pageid": "1",
"name": "\u65b0\u95fb",
"url": "http:\/\/www.cmstop.dev\/",
"hasChildren":true
}, {
"pageid": "2",
"name": "\u89c6\u9891",
"url": "http:\/\/video.cmstop.dev\/",
"hasChildren":true
}, {
"pageid": "3",
"name": "\u4e13\u9898",
"url": "http:\/\/special.cmstop.dev\/",
"hasChildren":false
}]
}
返回字段说明:
|
参数 |
名称 |
备注 |
|
pageid |
页面编号 |
|
|
name |
页面名称 |
|
|
url |
页面地址 |
可选,没有为空 |
|
hasChildren |
是否有子页面 |
用于树形加载时的判断,布尔值 |
4.3.2 读取区块列表
接口地址:<gateway>?app=page&controller=section&action=ls
接受参数:
|
参数 |
名称 |
传递类型 |
值类型 |
备注 |
|
pageid |
页面编号 |
GET |
整型 |
必须传递,读取该页面的区块列表 |
返回数据:
{
"state": true,
"data": [{
"sectionid": "9",
"pageid": "1",
"name": "\u4eca\u65e5\u5934\u6761",
"type": "hand",
"output": "html",
"rows": "1",
"published": "1341475092"
}, {
"sectionid": "10",
"pageid": "1",
"name": "\u4eca\u65e5\u5934\u6761-\u76f8\u51732",
"type": "hand",
"output": "html,xml",
"rows": "2",
"published": "1336614279"
}]
}
返回字段说明:
|
参数 |
名称 |
备注 |
|
pageid |
页面编号 |
|
|
sectionid |
区块编号 |
|
|
name |
区块名称 |
|
|
type |
区块类型 |
push推荐区块,auto 自动区块, hand 手动区块, html 代码区块 |
|
output |
输出类型 |
可能的值有html,xml,json三种类型 |
|
rows |
输出条数 |
|
|
published |
发布时间 |
时间戳格式 |
4.3.3 读取区块内容
接口地址:<gateway>?app=page&controller=section&action=get
接受参数:
|
参数 |
名称 |
传递类型 |
值类型 |
备注 |
|
sectionid |
区块编号 |
GET |
整型 |
必须传递,读取该区块的数据列表 |
注:该接口仅支持手动区块和推送区块。
返回数据:
{
"state": true,
"data": [
[{
"title": "\u7f8e\u56fd\u603b\u7edf\u5965\u5df4\u9a6c\u6253\u7bee\u7403\u53d7\u4f24\u7f1d12\u9488",
"color": "#336666",
"url": "http:\/\/news.cmstop.dev\/2010\/1128\/77.shtml",
"subtitle": "",
"suburl": "",
"thumb": "http:\/\/upload.cmstop.dev\/2010\/1201\/1291177912642.jpg",
"description": "11\u670826\u65e5\u7f8e\u56fd\u603b\u7edf\u5965\u5df4\u9a6c\u5728\u534e\u76db\u987f\u9ea6\u514b\u5948\u5c14\u5821\u519b\u4e8b\u57fa\u5730\u6253\u7bee\u7403\u65f6\u53d7\u4f24\u3002\u767d\u5bab\u53d1\u8a00\u4eba\u7f57\u4f2f\u7279\u00b7\u5409\u5e03\u65af\u8bf4\uff0c\u7403\u8d5b\u4e2d\u4e00\u540d\u7403\u5458\u8098\u90e8\u4e0d\u5c0f\u5fc3\u649e\u5230\u5965\u5df4\u9a6c\u5634\u5507\uff0c\u9020\u6210\u5965\u5df4\u9a6c\u53d7\u4f24\u3002\u636e\u6089\uff0c\u767d\u5bab\u533b\u7597\u5c0f\u7ec4\u7684\u533b\u751f\u5df2\u7ecf\u7ed9\u4ed6\u7684\u5634\u5507\u7f1d\u4e8612\u9488",
"time": 1336614279
}],
[{
"title": "\u4e9a\u8fd0\u793c\u670d\u592a\u6027\u611f\u60f9\u4e89\u8bae",
"color": "",
"url": "http:\/\/news.cmstop.dev\/2010\/1128\/72.shtml",
"subtitle": "",
"suburl": "",
"thumb": "http:\/\/upload.cmstop.dev\/2010\/1201\/1291178220682.jpg",
"description": "\u4e9a\u8fd0\u8d5b\u573a\u4e0a\u53e6\u4e00\u9053\u7f8e\u4e3d\u7684\u98ce\u666f\u7ebf\u90fd\u96c6\u4e2d\u5728\u4e86\u9881\u5956\u793c\u4eea\u5c0f\u59d0\u548c\u5404\u4e2a\u573a\u9986\u7684\u62c9\u62c9\u961f\uff0c\u6027\u611f\u3001\u7f8e\u4e3d\u7684\u59d1\u5a18\u4eec\u6210\u4e3a\u6444\u5f71\u8bb0\u8005\u7684\u4e3b\u89d2\u3002\u4e0d\u8fc7\uff0c\u8fd9\u4e9b\u9752\u6625\u9753\u4e3d\u7684\u4e2d\u56fd\u59d1\u5a18\u4e5f\u56e0\u7f8e\u4e3d\u62db\u6765\u975e\u8bae\u3002",
"time": 1336614279
}]
]
}
注:区块返回内容的data字段,手动区块是二维数组,每行允许多条数据;推送区块是一维数组,每行只有一个标题。
返回字段说明:
|
参数 |
名称 |
备注 |
|
title |
标题 |
|
|
color |
标题颜色 |
#XXXXXX 6位的标准HTML颜色代码 |
|
url |
链接地址 |
|
|
subtitle |
副标题 |
|
|
suburl |
副题链接 |
|
|
thumb |
缩略图 |
|
|
description |
描述 |
|
|
time |
发布时间 |
时间戳格式 |
4.3.4 读取区块HTML
接口地址:<gateway>?app=page&controller=section&action=gethtml
接受参数:
|
参数 |
名称 |
传递类型 |
值类型 |
备注 |
|
sectionid |
区块编号 |
GET |
整型 |
必须传递,读取该区块的HTML |
注:只有当区块选择生成HTML,并且已发布时才可以输出HTML。
返回数据:
{
"state": true,
"data": "<h2>\n<a href=\"http:\/\/news.cmstop.dev\/2010\/1112\/306.shtml\"
target=\"_blank\" class=\"cor-c00 bold\" title=\"\">
\u57fa\u7840\u63a7\u4ef6\u548c\u4ea4\u4e92\u8bbe\u8ba1\u5143\u7d20\u7684\u5c42\u7ea7<\/a>\n2012\/0514\/1336964832823.jpg<\/h2>\n"
}
返回字段说明:
|
参数 |
名称 |
备注 |
|
data |
HTML内容 |
|
4.4 内容接口
内容接口仅提供了一个接口用于读取内容列表,支持多种条件的数据筛选。
4.4.1 读取内容列表
接口地址:<gateway>?app=system&controller=content&action=ls
接受参数:
|
参数 |
名称 |
传递类型 |
值类型 |
备注 |
|
contentid |
内容编号 |
GET |
整型,字符串 |
指定要调用内容的ID,调用多个ID用英文逗号”,”隔开 |
|
modelid |
模型编号 |
GET |
整型,字符串 |
指定要调用的内容模型ID,调用多个ID用英文逗号”,”隔开 |
|
catid |
栏目编号 |
GET |
整型,字符串 |
指定要查询的栏目ID,调用多个ID用英文逗号”,”隔开 |
|
sourceid |
来源编号 |
GET |
整型,字符串 |
指定内容的来源ID,调用多个ID用英文逗号“,”隔开 |
|
weight |
内容权重 |
GET |
整型,字符串 |
指定内容的权重,包含以下四种形式: weight="60"表示调取权重值等于60的内容 weight="60,"表示调取权重值大于等于60的内容 weight=",60"表示调取权重值小于等于60的内容 weight="60,100"表示调取权重值大于等于60,且小于等于100的内容 |
|
published |
发布时间 |
GET |
字符串 |
指定内容的发布时间,有以下几种形式: published="2011-08-15" 表示调用发布时间为2011年 08月15日的内容 published="2011-08-15," 表示调用发布时间大于2011年08月 15日的内容 published=",2011-08-15" 表示调用发布时间小于2011年08月15日 的内容 published="2011-05-10,2011-08-15" 表示调用发布时间大于2011年05 月10日,且小于2011年08月15日的内容 published="2011-08-15 12:30:00"表示调用发布时间为2011年08月15日12时30分整的内容 published="2" 表示调用2天以内发布的内容 |
|
createdby |
创建人编号 |
GET |
整型,字符串 |
指定内容的创建人 ID,调用多个 ID 用英文逗号“,”隔开 |
|
tags |
标签 |
GET |
字符串 |
指定内容包含的关键词,多个关键词用英文逗号“,”隔开,例如:tags="福布斯,power" |
|
orderby |
排序条件 |
GET |
字符串 |
指定排序条件,多个排序条件用英文逗号“,”隔开,例如: orderby="published desc, pv desc, comments desc, weight desc" |
|
offset |
|
GET |
整型 |
内容表查询结果偏移值(必须是正整数),默认值为 0,例offset=”1”代表从第二条数据开始调取 |
|
size |
|
GET |
整型 |
内容表查询结果返回条数限制(必须是正整数),默认是10条 |
|
page |
|
GET |
整型 |
当前页码 |
注:所有的参数条件是AND关系。
返回数据:
{
"state": true,
"data": [{
"contentid": "74",
"catid": "8",
"modelid": "1",
"title": "\u91cd\u5e86\u65e5\u62a5\u518d\u63d0\u8584\u7199\u6765\u8bb2",
"subtitle": "",
"color": "",
"thumb": "",
"tags": "\u8584\u7199\u6765 \u80fd\u89c1 \u5ba3\u4f20\u5de5\u4f5c",
"sourceid": "2",
"url": "http:\/\/ent.cmstop.dev\/2012\/0214\/74.shtml",
"weight": "60",
"status": "6",
"created": "1329211972",
"createdby": "1",
"published": "1329211972",
"publishedby": "1",
"allowcomment": "1",
"comments": "0",
"pv": "0",
"spaceid": null,
"related": "0",
"score": "0",
"topicid": "74"
}]
}
返回字段说明:
|
参数 |
名称 |
备注 |
|
contentid |
内容编号 |
|
|
catid |
栏目编号 |
|
|
modelid |
模型编号 |
|
|
title |
标题 |
|
|
subtitle |
副标题 |
|
|
color |
标题颜色 |
#XXXXXX 6位的标准HTML颜色代码 |
|
thumb |
缩略图 |
|
|
tags |
标签 |
多个标签以空格隔开 |
|
sourceid |
来源编号 |
|
|
url |
内容链接 |
|
|
weight |
权重 |
|
|
status |
状态 |
这里的状态永远为6,只允许列出已发布的文章 |
|
created |
创建时间 |
|
|
createdby |
创建人编号 |
|
|
published |
发布时间 |
|
|
publishedby |
发布人编号 |
|
|
allowcomment |
是否允许评论 |
|
|
comments |
评论数 |
|
|
pv |
浏览量 |
|
|
spaceid |
所属专栏编号 |
|
|
related |
是否有相关内容 |
0 无相关内容,1 有相关内容,相关内容在其它表中 |
|
score |
评分 |
|
|
topicid |
评论话题编号 |
用来调用评论时使用 |
4.5 文章接口
文章接口提供了两个分别用于获取文章的具体内容和添加文章。
4.5.1 读取文章内容
接口地址:<gateway>?app=article&controller=article&action=get
接受参数:
|
参数 |
名称 |
传递类型 |
值类型 |
备注 |
|
contentid |
内容编号 |
GET |
整型 |
必须传递,读取该编号的具体内容 |
返回数据:
{
"state": true,
"data": {
"contentid": "172",
"catid": "7",
"modelid": "1",
"title": "\u6211\u662f\u6765\u6d4b2\u8bd5API\u76844",
"subtitle": "",
"color": "",
"thumb": "",
"tags": "\u6d4b\u8bd5 API",
"sourceid": "1",
"topicid": null,
"url": "http:\/\/ent.cmstop.dev\/2012\/0712\/172.shtml",
"weight": "60",
"status": "6",
"created": "1341819663",
"createdby": "2",
"published": "1342062317",
"publishedby": "2",
"iscontribute": "0",
"spaceid": "1",
"related": "1",
"pv": 1,
"allowcomment": "0",
"comments": "0",
"score": "0",
"tweeted": "0",
"author": "coldstar",
"editor": "coldstar",
"description": "\u6211\u53ea\u662f\u6d4b\u8bd5\u4e00\u4e0b",
"content": "<p>\u8fd9\u91cc\u662f\u6d4b2\u8bd5\u7684\u5185\u5bb9api<\/p>",
"pagecount": "0",
"saveremoteimage": "1",
"source_url": "",
"source_name": "\u65b0\u6d6a",
"source": "\u65b0\u6d6a",
"source_logo": null,
"keywords": [{
"tag": "\u6d4b\u8bd5",
"url": "http:\/\/app.cmstop.dev\/tags.php?tag=%E6%B5%8B%E8%AF%95"
}, {
"tag": "API",
"url": "http:\/\/app.cmstop.dev\/tags.php?tag=API"
}],
"proids": "3",
"relateds": [{
"relatedid": "4",
"contentid": "172",
"orign_contentid": "175",
"title": "\u6211\u662f\u6765\u6d4b2\u8bd5API\u76844",
"thumb": "null",
"url": "http:\/\/ent.cmstop.dev\/2012\/0709\/175.shtml",
"time": "2012-07-09",
"sort": "0"
}, {
"relatedid": "5",
"contentid": "172",
"orign_contentid": "150",
"title": "\u300a\u98de\u8d8a\u8001\u4eba\u9662\u300b\u66dd\u4e3b\u6d77\u62a5 \u8001\u4eba\u5e2e\u96c6\u7ed3\u6b32\u5f00\u6218",
"thumb": "",
"url": "http:\/\/news.cmstop.dev\/2012\/0411\/150.shtml",
"time": "2012-04-11",
"sort": "1"
}],
"author_url": "http:\/\/space.cmstop.dev\/coldstar",
"author_name": "coldstar"
}
}
返回字段说明:
|
参数 |
名称 |
备注 |
|
contentid |
内容编号 |
|
|
catid |
栏目编号 |
|
|
modelid |
模型编号 |
|
|
title |
标题 |
|
|
subtitle |
副标题 |
|
|
color |
标题颜色 |
#XXXXXX 6位的标准HTML颜色代码 |
|
thumb |
缩略图 |
|
|
tags |
标签 |
多个标签以空格隔开 |
|
sourceid |
来源编号 |
|
|
topicid |
评论话题编号 |
用来调用评论时使用 |
|
url |
内容链接 |
|
|
weight |
权重 |
|
|
status |
状态 |
这里的状态永远为6,只允许列出已发布的文章 |
|
created |
创建时间 |
|
|
createdby |
创建人编号 |
|
|
published |
发布时间 |
|
|
publishedby |
发布人编号 |
|
|
iscontribute |
是否来自投稿 |
|
|
spaceid |
所属专栏编号 |
|
|
related |
是否有相关内容 |
0 无相关内容,1 有相关内容, 相关内容在relateds字段中以二维数组方式输出 |
|
pv |
浏览量 |
|
|
allowcomment |
是否允许评论 |
|
|
comments |
评论数 |
|
|
score |
评分 |
|
|
tweeted |
是否已被转发 |
如果该内容已被转发微博,则为1,否则为0 |
|
author |
作者名称 |
|
|
editor |
编辑名称 |
|
|
description |
内容描述 |
|
|
content |
内容 |
|
|
pagecount |
分页数量 |
|
|
source_url |
来源地址 |
|
|
source_name |
来源名称 |
|
|
source |
来源名称 |
|
|
source_logo |
来源LOGO |
URL地址 |
|
keywords |
关键词列表 |
该内容是二维数组,字段参考: keywords数据说明 |
|
proids |
属性编号 |
多个属性以英文逗号(,)隔开 |
|
relateds |
相关内容列表 |
该内容是二维数据,字段参考: relateds数据说明 |
|
author_url |
专栏作者地址 |
|
|
author_name |
专栏作者名称 |
|
keyword数据说明:
|
参数 |
名称 |
备注 |
|
tag |
关键词名称 |
|
|
url |
关键词链接 |
|
relateds数据说明:
|
参数 |
名称 |
备注 |
|
relatedid |
相关内容编号 |
|
|
contentid |
内容编号 |
|
|
orign_contentid |
原始内容编号 |
|
|
title |
标题 |
|
|
thumb |
缩略图 |
|
|
url |
链接地址 |
|
|
time |
内容发布时间 |
|
|
sort |
相关排序 |
|
4.5.2 添加文章内容
目前文章添加仅支持普通文字数据添加,不支持图片上传,若需使用图片,请通过其它方式完成图片上传后在内容或缩略图中引用图片地址。
接口地址:<gateway>?app=article&controller=article&action=add
接受参数:
|
参数 |
名称 |
传递类型 |
值类型 |
备注 |
|
catid |
栏目编号 |
POST |
整型 |
必填 |
|
title |
标题 |
POST |
字符串 |
必填 |
|
subtitle |
副标题 |
POST |
字符串 |
可选 |
|
color |
标题颜色 |
POST |
字符串 |
可选,#XXXXXX 6位的标准颜色代码 |
|
tags |
标签 |
POST |
字符串 |
可选,多个标签以英文空格隔开 |
|
source |
来源 |
POST |
字符串 |
可选 |
|
author |
作者 |
POST |
字符串 |
可选 |
|
editor |
编辑 |
POST |
字符串 |
可选 |
|
content |
内容 |
POST |
字符串 |
必填 |
|
description |
描述 |
POST |
字符串 |
可选 |
|
saveremoteimage |
是否下载远程图片 |
POST |
整型 |
可选,1为下载,0为不处理 |
|
thumb |
缩略图 |
POST |
字符串 |
可选,图片HTTP路径,绝对或相对 |
|
proids |
属性 |
POST |
字符串 |
可选,多个属性编号以英文逗号隔开 |
|
weight |
权重 |
POST |
整型 |
可选,默认为60 |
|
sectionids |
页面 |
POST |
字符串 |
可选,多个区块编号以英文逗号隔开 |
|
placeid |
专题 |
POST |
字符串 |
可选,多个区块编号以英文逗号隔开 |
|
published |
发布时间 |
POST |
字符串 |
可选,标准的时间格式,2012-12-12 00:00:00 |
|
unpublished |
下线时间 |
POST |
字符串 |
可选,标准的时间格式,2012-12-12 00:00:00 |
|
related_keywords |
相关内容关键词 |
POST |
字符串 |
可选,多个关键词以英文空格分开 |
|
allowcomment |
是否允许评论 |
POST |
整型 |
可选,允许评论为1,不允许为0 |
|
status |
状态 |
POST |
整型 |
可选,1为草稿,3为待审,6为发布 |
返回数据:
添加成功,但未发布时:
{
"state": true,
"contentid": 183
}
或,发布成功时返回URL:
{
"state": true,
"contentid": 183,
"url":"http:\/\/ent.cmstop.dev\/2012\/0712\/183.shtml"
}
添加失败时,返回标准错误。
4.6 视频接口
视频接口提供了两个分别用于获取视频的具体内容和添加视频。
4.6.1 读取视频内容
接口地址:<gateway>?app=video&controller=video&action=get
接受参数:
|
参数 |
名称 |
传递类型 |
值类型 |
备注 |
|
contentid |
内容编号 |
GET |
整型 |
必须传递,读取该编号的具体内容 |
返回数据:
{
"state": true,
"data": {
"contentid": "75",
"catid": "5",
"modelid": "4",
"title": "\u89c6\u9891: \u4e60\u8fd1\u5e73\u63a5\u53d7\u7f8e\u56fd\u300a
\u534e\u76db\u987f\u90ae\u62a5\u300b\u4e66\u9762\u91c7\u8bbf",
"subtitle": "",
"color": "",
"thumb": "2012\/0215\/1329278589616.jpg",
"tags": "\u534e\u76db\u987f\u90ae\u62a5 \u4e60\u8fd1\u5e73
\u7f8e\u56fd \u4e66\u9762 \u89c6\u9891",
"sourceid": "3",
"topicid": "75",
"url": "http:\/\/news.cmstop.dev\/2012\/0215\/75.shtml",
"weight": "60",
"status": "6",
"created": "1329278593",
"createdby": "1",
"published": "1329278580",
"publishedby": "1",
"iscontribute": "0",
"spaceid": null,
"related": "1",
"pv": "0",
"allowcomment": "1",
"comments": "0",
"score": "0",
"tweeted": "0",
"aid": "0",
"video": "http:\/\/player.youku.com\/player.php\/sid\/XMzUyNDgwMjQ4\/v.swf",
"playtime": "76",
"description": "\u89c6\u9891: \u4e60\u8fd1\u5e73\u63a5\u53d7\u7f8e\u56fd\u300a
\u534e\u76db\u987f\u90ae\u62a5\u300b\u4e66\u9762\u91c7\u8bbf
120214 \u65b0\u95fb\u8054\u64ad ",
"editor": "CmsTop",
"source_url": "",
"source_name": "youku",
"source": "youku",
"source_logo": null,
"keywords": [{
"tag": "\u534e\u76db\u987f\u90ae\u62a5",
"url": "http:\/\/app.cmstop.dev\/tags.php?tag=%E5%8D%8E%E7%9B%9B
%E9%A1%BF%E9%82%AE%E6%8A%A5"
}, {
"tag": "\u4e60\u8fd1\u5e73",
"url": "http:\/\/app.cmstop.dev\/tags.php?tag=%E4%B9%A0%E8%BF
%91%E5%B9%B3"
}, {
"tag": "\u7f8e\u56fd",
"url": "http:\/\/app.cmstop.dev\/tags.php?tag=%E7%BE%8E%E5%9B%BD"
}, {
"tag": "\u4e66\u9762",
"url": "http:\/\/app.cmstop.dev\/tags.php?tag=%E4%B9%A6%E9%9D%A2"
}, {
"tag": "\u89c6\u9891",
"url": "http:\/\/app.cmstop.dev\/tags.php?tag=%E8%A7%86%E9%A2%91"
}],
"proids": "",
"relateds": [{
"relatedid": "8",
"contentid": "75",
"orign_contentid": "148",
"title": "\u4e13\u5bb6\u9274\u5b9a\u79f0\u5c71\u4e1c\u67a3\u5e84
\u6355\u83b7\u91ce\u72fc\u786e\u4e3a\u5ba0\u7269\u72d7\u54c8\u58eb\u5947",
"thumb": "",
"url": "http:\/\/news.cmstop.dev\/2012\/0328\/148.shtml",
"time": "2012-03-28",
"sort": "0"
}, {
"relatedid": "9",
"contentid": "75",
"orign_contentid": "61",
"title": "\u5317\u4eac\u5c45\u6c11\u4f4f\u9662\u62a5\u9500\u5347\u81f370% \u5916\u5730\u6237\u7c4d\u5c06\u4eab\u751f\u80b2\u9669",
"thumb": "",
"url": "http:\/\/ent.cmstop.dev\/2011\/1221\/61.shtml",
"time": "2011-12-21",
"sort": "1"
}]
}
}
返回字段说明:
|
参数 |
名称 |
备注 |
|
contentid |
内容编号 |
|
|
catid |
栏目编号 |
|
|
modelid |
模型编号 |
|
|
title |
标题 |
|
|
subtitle |
副标题 |
|
|
color |
标题颜色 |
#XXXXXX 6位的标准HTML颜色代码 |
|
thumb |
缩略图 |
|
|
tags |
标签 |
多个标签以空格隔开 |
|
sourceid |
来源编号 |
|
|
topicid |
评论话题编号 |
用来调用评论时使用 |
|
url |
内容链接 |
|
|
weight |
权重 |
|
|
status |
状态 |
这里的状态永远为6,只允许列出已发布的文章 |
|
created |
创建时间 |
|
|
createdby |
创建人编号 |
|
|
published |
发布时间 |
|
|
publishedby |
发布人编号 |
|
|
iscontribute |
是否来自投稿 |
|
|
spaceid |
所属专栏编号 |
|
|
related |
是否有相关内容 |
0 无相关内容,1 有相关内容, 相关内容在relateds字段中以二维数组方式输出 |
|
pv |
浏览量 |
|
|
allowcomment |
是否允许评论 |
|
|
comments |
评论数 |
|
|
score |
评分 |
|
|
tweeted |
是否已被转发 |
如果该内容已被转发微薄,则为1,否则为0 |
|
aid |
附件编号 |
|
|
video |
视频地址 |
|
|
playtime |
视频时长 |
|
|
description |
内容描述 |
|
|
editor |
编辑 |
|
|
source_url |
来源地址 |
|
|
source_name |
来源名称 |
|
|
source |
来源名称 |
|
|
source_logo |
来源LOGO |
URL地址 |
|
keywords |
关键词列表 |
该内容是二维数组,字段参考: keywords数据说明 |
|
proids |
属性编号 |
多个属性以英文逗号(,)隔开 |
|
relateds |
相关内容列表 |
该内容是二维数据,字段参考: relateds数据说明 |
keyword数据说明:
|
参数 |
名称 |
备注 |
|
tag |
关键词名称 |
|
|
url |
关键词链接 |
|
relateds数据说明:
|
参数 |
名称 |
备注 |
|
relatedid |
相关内容编号 |
|
|
contentid |
内容编号 |
|
|
orign_contentid |
原始内容编号 |
|
|
title |
标题 |
|
|
thumb |
缩略图 |
|
|
url |
链接地址 |
|
|
time |
内容发布时间 |
|
|
sort |
相关排序 |
|
4.6.2 添加视频内容
目前仅支持添加常规的视频内容调用,暂不支持视频上传,视频地址要求为HTTP资源地址(如http://domain.com/xxx/xxx.mp4、youku的视频地址),或者合作方的视频标识(如:[ctvideo]uj3edfcikewi8p0refelfdsg[/ctivdeo])等。
接口地址:<gateway>?app=video&controller=video&action=add
接受参数:
|
参数 |
名称 |
传递类型 |
值类型 |
备注 |
|
catid |
栏目编号 |
POST |
整型 |
必填 |
|
title |
标题 |
POST |
字符串 |
必填 |
|
subtitle |
副标题 |
POST |
字符串 |
可选 |
|
color |
标题颜色 |
POST |
字符串 |
可选,#XXXXXX 6位的标准颜色代码 |
|
tags |
标签 |
POST |
字符串 |
可选,多个标签以英文空格隔开 |
|
video |
视频地址 |
POST |
字符串 |
必填,视频播放地址,可为绝对地址或视频标识 |
|
playtime |
视频时长 |
POST |
整型 |
必填,以秒(s)为单位 |
|
aid |
附件编号 |
POST |
整型 |
可选 |
|
source |
来源 |
POST |
字符串 |
可选 |
|
editor |
编辑 |
POST |
字符串 |
可选 |
|
description |
描述 |
POST |
字符串 |
可选 |
|
thumb |
缩略图 |
POST |
字符串 |
可选,图片HTTP路径,绝对或相对 |
|
proids |
属性 |
POST |
字符串 |
可选,多个属性编号以英文逗号隔开 |
|
weight |
权重 |
POST |
整型 |
可选,默认为60 |
|
sectionids |
页面 |
POST |
字符串 |
可选,多个区块编号以英文逗号隔开 |
|
placeid |
专题 |
POST |
字符串 |
可选,多个区块编号以英文逗号隔开 |
|
published |
发布时间 |
POST |
字符串 |
可选,标准的时间格式,2012-12-12 00:00:00 |
|
unpublished |
下线时间 |
POST |
字符串 |
可选,标准的时间格式,2012-12-12 00:00:00 |
|
related_keywords |
相关内容关键词 |
POST |
字符串 |
可选,多个关键词以英文空格分开 |
|
allowcomment |
是否允许评论 |
POST |
整型 |
可选,允许评论为1,不允许为0 |
|
status |
状态 |
POST |
整型 |
可选,1为草稿,3为待审,6为发布 |
返回数据:
添加成功,但未发布时:
{
"state": true,
"contentid": 184
}
或,发布成功时返回URL:
{
"state": true,
"contentid": 184,
"url":"http:\/\/video.cmstop.dev\/2012\/0712\/184.shtml"
}
添加失败时,返回标准错误。
编辑:王玚
网友评论