Package com.qq.open.weibo.bean.result

Examples of com.qq.open.weibo.bean.result.WeiBoAddIdolResultBean


   
    // 获取接口返回的数据
    String jsonData = oqu.doPost(OpenQqConstants.WEIBO_ADD_IDOL_URL, this.getInterfaceParam(paramBean));
   
    // 返回数据
    WeiBoAddIdolResultBean resultBean = this.jsonToBean(jsonData);
   
    // 日志
    log.info("收听腾讯微博上的用户 结束...");
   
    return resultBean;
View Full Code Here


   * @throws JSONException
   * @throws JSONException
   */
  private WeiBoAddIdolResultBean jsonToBean(String jsonData) throws JSONException {
   
    WeiBoAddIdolResultBean resultBean = new WeiBoAddIdolResultBean();
   
    JSONObject jsonObjRoot;
    try {
      jsonObjRoot = new JSONObject(jsonData);
     
      // 接口返回错误的场合
      if (jsonObjRoot.getInt("ret") != 0) {
        // 设置错误标识为真
        resultBean.setErrorFlg(true);
        // 设置错误编号
        resultBean.setErrorCode(jsonObjRoot.get("errcode").toString());
        // 设置错误内容
        resultBean.setErrorMes(jsonObjRoot.getString("msg"));
      }
    } catch (JSONException e) {
      e.printStackTrace();
      // 日志
      log.error("addIdol 异常,json数据是:" + jsonData);
View Full Code Here

    paramBean.setName("NokiaChina,ilovethinkpad");
   
   
    WeiBoAddIdol addIdol = new WeiBoAddIdol();
   
    WeiBoAddIdolResultBean resultBean = addIdol.addIdol(paramBean);
   
    if (resultBean.getErrorFlg()) {
      System.out.println("Error!!");
    } else {
      System.out.println("Success!!");
    }
    System.exit(0);
View Full Code Here

   * @return Bean数据
   * @throws JSONException
   */
  private WeiBoAddIdolResultBean jsonToBean(String jsonData) throws JSONException {
   
    WeiBoAddIdolResultBean resultBean = new WeiBoAddIdolResultBean();
   
    JSONObject jsonObjRoot = new JSONObject(jsonData);
   
    // 接口返回错误的场合
    if (jsonObjRoot.getInt("ret") != 0) {
      // 设置错误标识为真
      resultBean.setErrorFlg(true);
      // 设置错误编号
      resultBean.setErrorCode(jsonObjRoot.get("errcode").toString());
      // 设置错误内容
      resultBean.setErrorMes(jsonObjRoot.getString("msg"));
    }
   
    return resultBean;
  }
View Full Code Here

TOP

Related Classes of com.qq.open.weibo.bean.result.WeiBoAddIdolResultBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.