Changes between Version 6 and Version 7 of web-intf


Ignore:
Timestamp:
02/13/2012 06:21:45 PM (14 years ago)
Author:
yangbo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • web-intf

    v6 v7  
    1041045.接口中的JSON字符串,key都用双引号("")包裹,value是字符串类型时,也用双引号("")包裹,并且过滤掉回车换行,对字符串中包含的双引号(")进行转义;是数字类型时,不用引号。 
    105105 
     1066.本系统相关的周边系统有:互动核心平台(BIP)、公共帐号登录(PASSPORT)、图片上传中心(UPC),这些系统的测试环境配置可以参考 http://bbs.pconline.cn/topic-1894.html 
     107 
    106108}}} 
    107109 
    108110== 2. [=#point200 互动核心平台接口 ]  == 
     111        互动核心平台会发布API包--bipClient.jar,这个jar会提供动态和系统消息的创建、系统消息的获取、动态的获取和关注的调用接口。 
     112 
    109113=== 2.1 [=#point201 发送系统消息 ] === 
     114        1、接口地址 
     115 
     116           测试环境接口:http://192.168.74.8:1218/?name=httpsqs_master&opt=put 
     117 
     118           正式环境接口:http://queue.pconline.com.cn:1218/?name=httpsqs_master&opt=put 
     119         
     120        2、newsfeed 方法说明: 
     121{{{ 
     122    public boolean newsfeed(long accountId,long typeId, Map<String,Object> contents){ 
     123         
     124        if (accountId <= 0 || typeId <= 0  
     125                || contents == null || contents.isEmpty()  
     126                || ucServer ==null || queueServer.length() == 0) { 
     127             return false; 
     128        } 
     129 
     130        String jsonContent = cacheParser.unparse(contents); 
     131         
     132        Map<String,Object> msg = new HashMap<String,Object>(4); 
     133        msg.put("act","create"); 
     134        msg.put("accountId", accountId); 
     135        msg.put("typeId", typeId); 
     136        msg.put("content", jsonContent); 
     137         
     138        Map<String,Object> dataMap = new HashMap<String,Object>(3); 
     139        dataMap.put("appName", "bip"); 
     140        dataMap.put("actionType", "createNewsfeed"); 
     141        dataMap.put("msg", msg); 
     142         
     143        String data = cacheParser.unparse(dataMap); 
     144        Map<String,Object> params = new HashMap<String,Object>(1); 
     145        params.put("data", data); 
     146         
     147        try { 
     148            JsonResult json =  post(queueServer, params); 
     149            return json.getCode()==0; 
     150        } catch (Exception e) { 
     151            JsonResult json = new JsonResult(); 
     152            json.setMessage(-1, e.getMessage());e.printStackTrace(); 
     153            return false; 
     154        } 
     155    } 
     156}}} 
     157        sysnotice 方法说明 
     158{{{ 
     159    public int sysnotice(long senderId,long accountId,long typeId, Map<String,Object> contents){ 
     160 
     161        if (accountId <= 0 || typeId <= 0  
     162                || contents == null || contents.isEmpty()  
     163                || queueServer ==null || queueServer.length() == 0) { 
     164             return -1; 
     165        } 
     166         
     167        String jsonContent = cacheParser.unparse(contents); 
     168         
     169        Map<String,Object> msg = new HashMap<String,Object>(3); 
     170        msg.put("act","create"); 
     171        msg.put("accountId", accountId); 
     172        msg.put("typeId", typeId); 
     173        msg.put("content", jsonContent); 
     174        msg.put("senderId", senderId); 
     175         
     176        Map<String,Object> dataMap = new HashMap<String,Object>(2); 
     177        dataMap.put("appName", "bip"); 
     178        dataMap.put("actionType", "createSysnotice"); 
     179        dataMap.put("msg", msg); 
     180         
     181        String data = cacheParser.unparse(dataMap); 
     182        Map<String,Object> params = new HashMap<String,Object>(3); 
     183        params.put("data", data); 
     184         
     185        try { 
     186            JsonResult json =  post(queueServer, params); 
     187            return json.getCode(); 
     188        } catch (Exception e) { 
     189            JsonResult json = new JsonResult(); 
     190            json.setMessage(-1, e.getMessage()); 
     191            return -1; 
     192        } 
     193    } 
     194}}}            
    110195 
    111196=== 2.2 [=#point202 获取系统消息 ] === 
    112  
     197        1、接口地址 
     198 
     199            测试环境接口:http://test748.pconline.com.cn:8083/intf/sysnotice.jsp 
     200 
     201            正式环境接口:http://bip.pconline.com.cn/intf/sysnotice.jsp 
     202 
     203        2、参数说明 
     204{{{ 
     205            act         操作方式(查询:find;获得未读系统消息数量:getNum;) 
     206            accountId   用户ID(取谁的系统消息)siteId     网站编号(全网:0;电脑网:1;汽车网:2;游戏网:3;女性网:4;亲子网:5;家居网:6) 
     207            status      需要取什么状态的系统消息(全部:-1;未读:0;已读:1) 
     208            groupType   需要取哪个组的系统消息(全部:-1;系统通知:0;好友请求:1;邀请消息:2;关注通知:3) 
     209            pageNo      页码(第几页)(find 试用) 
     210            pageSize    每页显示数量(find 试用) 
     211            callback    回调 
     212            result      find:JsonResult(bipClient.jar)(json);getNum: int 
     213}}} 
    113214=== 2.3 [=#point203 更新系统消息状态 ] === 
    114215