Changes between Version 10 and Version 11 of price_jiekou


Ignore:
Timestamp:
07/19/2013 12:13:16 PM (13 years ago)
Author:
chenyu
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • price_jiekou

    v10 v11  
    1 优惠首页 
    2  
    3 发现 
    4  
    5 我的 
    6  
    7 优惠详情 
    8  
    9 发现详情 
    10  
    11 文章评论 
    12  
    13 === 1.1 优惠/发现 分类接口 === 
     1== 1.基本约定 == 
     2{{{ 
     31.当接口处理正常时,HTTP STATUS CODE 返回给200。包括有正常的业务数据和数据为空的情况。 
     4 
     52.当接口处理异常时,HTTP STATUS CODE 返回给500,并且给出具体的错误信息。 
     6    { 
     7        "uri" : "/intf/albums-by-type.jsp", 
     8        "error-desc":"Need you follow uid.", 
     9        "user-notice":"给用户的提示放在这里" 
     10    } 
     11 
     12     
     133.接口默认的字符编码是UTF-8,接口需要实现对req-enc和resp-enc参数的支持。在JSP的最顶部,实现类似下面的代码: 
     14 
     15        String queryString = request.getQueryString(); 
     16        String requestEncoding = getParam(queryString,"req_enc"); 
     17        String responseEncoding = getParam(queryString,"resp_enc"); 
     18        if(isNotBlank(requestEncoding)){ 
     19            request.setCharacterEncoding(requestEncoding); 
     20        } 
     21        if(isNotBlank(responseEncoding)){ 
     22            response.setCharacterEncoding(responseEncoding); 
     23        } 
     24 
     254.所有有写操作的数据接口,必须用POST方式提交,在接口里需要判断提交方式,拒绝GET的调用请求。 
     26 
     275.接口中的JSON字符串,key都用双引号("")包裹,value是字符串类型时,也用双引号("")包裹;是数字类型时,不用引号。 
     28 
     29}}} 
     30 
     31== 2.接口列表 == 
     32 
     33=== 2.1 优惠/发现 分类接口 === 
    1434{{{ 
    1535HTTP请求方式:get 
     
    4767}}} 
    4868 
    49 === 1.2文章列表接口 === 
     69=== 2.2文章列表接口 === 
    5070{{{ 
    5171    请求参数: 分类 
     
    7292}}} 
    7393 
    74 === 1.3 终端页接口 === 
     94=== 2.3 终端页接口 === 
    7595{{{ 
    7696请求方法:get 
     
    81101}}} 
    82102 
    83 === 1.4 评论列表接口 === 
     103=== 2.4 评论列表接口 === 
    84104{{{ 
    85105 HTTP请求方式:get 
     
    159179}}} 
    160180 
    161 1.5 发评论接口 
     181=== 2.5 发评论接口 === 
    162182{{{ 
    163183http://cmt.pcauto.com.cn/action/comment/create_utf8.jsp 
     
    181201}}} 
    182202 
    183 === 1.6 值不值接口 === 
     203=== 2.6 值不值接口 === 
    184204{{{ 
    185205    请求参数:  
     
    198218}}} 
    199219 
    200 === 1.7 摇一摇接口 === 
     220=== 2.7 摇一摇接口 === 
    201221{{{ 
    202222    请求参数: 无 
     
    223243}}} 
    224244 
    225 === 1.8 发现列表接口 === 
     245=== 2.8 发现列表接口 === 
    226246{{{ 
    227247    请求参数: 分类