[[TOC]] = 资讯4.9.0接口文档 (已完成接口开发机可测)= >mrobot代理环境说明: 192.168.10.198 端口为 1080 连的是QA测试环境(192.168.74.80)[[BR]] 192.168.10.199 端口为 1080 连的是dev40的开发环境(192.168.75.40)[[BR]] '''ps:对于mrobot.pcauto.com.cn/x/前缀的接口,mrobot仅作代理,没有任何逻辑处理。''' [[BR]] 制作地址:[[http://zzb.pcauto.com.cn/tools/gongdan/plan.php?id=173|猛戳前往]] [[BR]] 应用后端接口trac:[[http://trac.pc.com.cn/iphone/wiki/pcauto_4.8.2/interface|暂无]] == 1.资讯首页接口 == '''(敬请期待)'''[[BR]] >mrobot地址:http://mrobot.pcauto.com.cn/v2/cms/channel1?pageNo=1&pageSize=20 [[BR]] cms开发环境:http://test2.pcauto.com.cn:8002/app/21json/ [[BR]] cms线上环境:http://www.pcauto.com.cn/app/21json [[BR]] **说明** > 此接口为新首页接口,增加投票类型(type=10),gif(type=11);图赏增加image,专题增加大图[[BR]] **缓存时间** >首页列表5分钟,gif弹幕数和投票数据每六分钟刷新一次。 **提交方式** > GET **是否登录** > 否 **数据来源** > cms、快搜、cmt、直播后台等等 **参数** ||=参数名=||= 参数含义 =||= 类型 =||= 默认值 =||= 是否必须 =||=说明=|| ||=inreview=||= 是否苹果审核中 =||= int =||= 0 =||= 否 =||= 审核阶段不出广告 =|| ||=pageNo=||=页码=||= int =||= 1 =||= 否 =||= =|| ||=pageSize=||=每页条数=||= int =||= 200 =||= 否 =||= =|| **返回** {{{#!java { "data": [ { "articleType": "y", "channelId": 1, "channelName": "头条", "classfy": "图赏", "count": 0, "downs": 0, "id": "11113", "image": [ "http://www1.pcauto.com.cn/app/10228.jpg", "http://www1.pcauto.com.cn/app/10228.jpg", "http://www1.pcauto.com.cn/app/10228.jpg", ], "imageNum": 1, "imgCount": 0, "pubDate": "2016-02-16", "title": "专注时尚动感与精准驾控 威朗GS打造小钢炮新秀", "to-uri": "pcautobrowser://album-photo/11113", "type": 3, "ups": 0, "url": "http://beauty.pcauto.com.cn/photo/11113.html", "voteId": "" }, { "articleType": "y", "channelId": 1, "channelName": "头条", "classfy": "专题", "count": 0, "downs": 0, "id": "11114", "image": "", "bigImg": "", "pubDate": "2016-02-16", "title": "专注时尚动感与精准驾控 威朗GS打造小钢炮新秀", "to-uri": "", "type": 5, "ups": 0, "url": "", "voteId": "" }, { "articleType": "y", "classfy": "投票", "id": "7733569", "isPicture": 0, "itemId": 5470, "itemText": "问题1", "options": [ { "count": 3, "optionId": 16221, "optionPicture": "", "optionText": "宝马X5" }, { "count": 2, "optionId": 16222, "optionPicture": "", "optionText": "宝马MINI" } ], "totalCount": 5, "pubDate": "2013-01-01", "type": 10, "ups": 39, "url": "123", "voteId": "2414" }, { "title":"", "cmtCount":0, "coverPic":"", "url":"", "type": 11, "picHeight": 200, "pubDate": "2013-01-01" } ], "focus": [ { "articleType": "n", "id": "1623455", "image": "http://img0.pcauto.com.cn/pcauto/app/daogou/1108/201108311.jpg", "pubDate": "2011-08-31", "title": "哈弗H6挑战比亚迪S6/瑞虎/海马骑士", "topicUrl": "http://www.pcauto.com.cn/teach/1108/1622411.html", "url": "http://www.pcauto.com.cn/app/daogou/1108/1623455.html" } ], "pageNo": 1, "pageSize": 1, "topData": [ { "cc-uri": "http://count.imofan.com/count?url=http://www.pcauto.com.cn/nation/669/6690671.html&ad=132", "channelId": 0, "channelName": "", "count": 0, "downs": 0, "id": "161", "image": "http://img0.pcauto.com.cn/pcauto/1503/15/6055040_567.jpg", "isExtend": "0", "preView": "央视3·15晚会正在直播 消费在阳光下", "pubDate": "2015-03-15", "seq": 1, "title": "央视3·15晚会直播回顾 消费在阳光下", "to-uri": "pcautobrowser://information-article/161?template=live", "type": 4, "updateAt": 1436284800000, "ups": 0 } ], "topFocus": [ { "image": "http://www1.pcauto.com.cn/test/qwegf3wrefgvazv.jpg", "seq": 1, "title": "驾名爵锐腾1.5T四驱豪华版", "to-uri": "http://m.pcauto.com.cn/x/guangzhou/?type=zt&FromApp=1&browser=commonwebview&v=4.5.0", "updateAt": 1437408000000 } ], "total": 150 } }}} **返回参数说明** [[BR]] 在data与focus数组内的每一个JSONOject中type=10表示投票,11表示GIF[[BR]] ||= 参数名 =||= 参数含义 =|| ||= type =||= 1文章,2帖子,3图集,4直播,5专题,6活动,7那种用户4.5版本提完需求自己就忘掉了是什么的列表专题,9视频,10投票,11gif,0其他 =|| ||= image =||= type=3时,表示图片数组 =|| ||= imageNum =||= type=3时,表示图片数 =|| ||= bigImg =||= type=5时,表示大图 =|| ||= title =||= type=11时,表示gif标题 =|| ||= cmtCount =||= type=11时,表示gif弹幕数 =|| ||= coverPic =||= type=11时,表示gif封面图 =|| ||= url =||= type=11时,表示gif链接 =|| ||= picHeight =||= type=11时,表示gif高度 =|| ||= voteId =||= (后续字段均为type=10)投票项目id =|| ||= itemId =||= 问题id =|| ||= itemText =||= 问题内容 =|| ||= isPicture =||= 是否图片问题,1:是,0:否 =|| ||= options =||= 选项数组 =|| ||= count =||= 选项统计数量 =|| ||= optionId =||= 选项ID =|| ||= optionPicture =||= 选项图片 =|| ||= optionText =||= 选项内容 =|| ||= totalCount =||= 问题所有选项统计数量 =|| == 2.弹幕数据接口 == '''(mrobot已完成,请连开发机进行测试)'''[[BR]] >mrobot地址::http://mrobot.pcauto.com.cn/xsp/s/auto/info/xueChe/getCmtByUrl.xsp?url=http://www.pcauto.com.cn/nation/774/7748168.html&reverse=0&pageNo=1&pageSize=20 [[BR]] 后端接口:http://cmt.pcauto.com.cn/intf/url2tid.jsp?urls=http://www.pcauto.com.cn/nation/774/7748168.html [[BR]] http://cmt.pcauto.com.cn/action/comment/list_new_json.jsp?tId=13317121&arch=0&reverse=0&pageSize=20 [[BR]] **说明** > '''此接口只出首页弹幕数据,评论终端页请使用以前文章页的评论接口'''[[BR]] **缓存时间** >无 **提交方式** > GET **是否登录** > 否 **数据来源** **参数** ||=参数名=||= 参数含义 =||= 类型 =||= 默认值 =||= 是否必须 =||=说明=|| ||=url=||= 该弹幕所属gif链接 =||= String =||= =||= 是 =||= =|| ||=reverse=||= 评论排序 =||int||= 0 =||= 否 =||= 值为0倒序,1顺序 =|| ||=pageNo=||=页码=||= int =||= 1 =||= 否 =||= =|| ||=pageSize=||=每页条数=||= int =||= 20 =||= 否 =||= =|| **返回** {{{#!java { "comments": [ { "id": "29681519", "userId": "32059577", "name": "二两矿泉水", "floor": "122", "faceUrl": "http://i6.3conline.com/images/upload/upc/face/29/68/15/19/29681519_100x100", "content": "慢慢来吧,这个价格真的事不好玩啊" }, { "id": "29681424", "userId": "28393932", "name": "么西么西0518", "floor": "121", "faceUrl": "http://i6.3conline.com/images/upload/upc/face/29/68/14/24/29681424_100x100", "content": "原来哈弗H9的动力这么强悍!难怪售价这么高。" } ], "pageNo": 1, "pageCount": 61, "total": 122 } }}} **返回参数说明** ||= 参数名 =||= 参数含义 =|| ||= id =||= 评论id =|| ||= userId =||= 用户id =|| ||= name =||= 用户名称 =|| ||= floor =||= 楼层数 =|| ||= faceUrl =||= 头像 =|| ||= content =||= 评论内容 =|| == 3.GIF终端页JSON == '''(开发已完成,调试请连开发机代理)'''[[BR]] >mrobot地址:http://mrobot.pcauto.com.cn/xsp/s/auto/info/xueChe/gif_photo.xsp?url=http://dev2.pconline.com.cn:9191/upcfiles/autophotolib_bbs/1602/03/c0/40246_1454467582759.gif [[BR]] 后端接口: [[BR]] http://cmt.pcauto.com.cn/intf/url2tid.jsp?urls=http://dev2.pconline.com.cn:9191/upcfiles/autophotolib_bbs/1602/03/c0/40246_1454467582759.gif [[BR]] http://cmt.pcauto.com.cn/intf/countcmt.jsp?tids= [[BR]] http://dev31.pcauto.com.cn:8012/template/pcauto_bbs/intf/gif_photo.jsp?url=http://dev2.pconline.com.cn:9191/upcfiles/autophotolib_bbs/1602/03/c0/40246_1454467582759.gif **说明** > GIF终端页JSON[[BR]] **缓存时间** >无 **提交方式** > GET **是否登录** > 否 **数据来源** > **请求参数** ||= 参数名 =||= 类型 =||= 必须 =||= 说明 =|| ||=url=||=String=||=是=||=gif链接=|| **返回** {{{ { "desc": "", "height": 172, "name": "100862", "retCode": 1, "url": "http://dev2.pconline.com.cn:9191/upcfiles/autophotolib_bbs/1602/03/c0/40246_1454467582759.gif", "width": 170, "count": 0 } }}} **返回参数说明** ||= 参数名 =||= 参数含义 =|| ||= desc =||= 图集描述 =|| ||= height =||= 图片高度 =|| ||= name =||= 图集标题 =|| ||= retCode =||= 获取数据状态,值为1表示成功,0失败 =|| ||= url =||= gif链接 =|| ||= width =||= 图片宽度 =|| ||= count =||= 评论数 =|| ||= topicId =||= 用户获取评论的topicId,当没有评论时不存在=|| == 4.投票提交接口 == '''(该接口为投票系统开发,我只是义务写个trac方便大家,此接口问题请找投票系统)'''[[BR]] >非mrobot地址 [[BR]] 投票线上接口: [[BR]] http://survey.pcauto.com.cn/auto/channelSubmit.jsp?id=2434&q_5541=16325&q_5543=16333&q_5552=%E8%B1%AA%E8%BD%A6 [[BR]] 投票开发环境接口: [[BR]] http://dev13.pconline.com.cn:9099/channelSubmit.jsp?id=2434&q_5541=16325&q_5543=16333&q_5552=%E8%B1%AA%E8%BD%A6 [[BR]] **说明** > 投票提交接口[[BR]] **缓存时间** >无 **提交方式** > POST **是否登录** > 否 **数据来源** > 投票系统 **请求参数** ||= 参数名 =||= 类型 =||= 必须 =||= 说明 =|| ||=id=||=String=||=是=||=投票项目id=|| ||=q_itemId=||=String=||=是=||= q_前缀是必须的,itemId是问题的ID,optionId是选项的ID。多个问题写多个即可。如 q_5541:16326。(可参考上面的链接) =|| ||=callback=||=String=||=否=||=回调函数(可选)=|| ||=windowname=||=String=||=否=||=跨域用(可选参数)=|| **ajax提交示例** {{{ $.ajax({ type:"POST", url: 'http://dev13.pconline.com.cn:9099/channelSubmit.jsp?callback=test', data: {q_5541:'16325',q_5543:'16333',q_5552:'肯定是豪车啊',id:'2434'}, success: function(e){console.log(e)} }) }}} **返回** {{{ 失败: {"code":-1,result:"调查已经结束"} {"code":"-1","result":"调查已经结束"} {"code":"-2","result":"提交的调查不是最新的版本"} {"code":"-3","result":"调查已经提交过,请稍后再试"} {"code":"-4","result":"提交的验证码不正确"} {"code":"-3","result":"调查已经提交过,请稍后再试"} {"code":"-5","result":"调查参数提交不正确,或者题目数量与系统不符,请联系管理员。"} {"code":"-6","result":"提交操作错误"} 成功: { "code":"0", "result":[ { "id":"2434", //项目ID "title":"测试快速添加", //项目标题 "items":[ { //SUR_ITEM数据库表 "itemId":"5541", //问题ID "count":"9", //问题统计数量,SUR_RESULT_CHOICE表中SUR_ITEM_ID=5541的统计数量 + 当前提交数量 "options":[ { //SUR_OPTIONS数据库表 "optionId":"16326", //选项ID "count":"4" //选项统计数量, SUR_RESULT_CHOICE表中SUR_OPTIONS_ID=16326的统计数量 + 当前提交数量 } ] } ] } ] } }}}