Examples of QqAddBlogResultBean


Examples of com.qq.open.qzone.bean.result.QqAddBlogResultBean

   
    // 接口返回的json数据
    String jsonData = oqu.doPost(OpenQqConstants.QQ_ADD_ONE_BLOG_URL, reqEntity);
   
    // 返回接口返回的数据
    QqAddBlogResultBean resultBean = this.jsonToBean(jsonData);
   
    // 日志
    log.info("登录用户发表一篇新日志 结束....");
   
    return resultBean;
View Full Code Here

Examples of com.qq.open.qzone.bean.result.QqAddBlogResultBean

   * @throws JSONException
   * @throws JSONException
   */
  private QqAddBlogResultBean jsonToBean(String jsonData) throws JSONException {
    // 接口返回数据Bean
    QqAddBlogResultBean resultBean = new QqAddBlogResultBean();
   
    // 接口返回的数据json
    JSONObject jsonObjRoot;
    try {
      jsonObjRoot = new JSONObject(jsonData);
     
      // 接口返回错误的场合
      if (jsonObjRoot.getInt("ret") != 0) {
        // 设置错误标识为真
        resultBean.setErrorFlg(true);
       
        // 设置错误编号
        resultBean.setErrorCode(jsonObjRoot.get("ret").toString());
       
        // 设置错误信息
        resultBean.setErrorMes(jsonObjRoot.getString("msg"));
      } else {
        resultBean.setUrl(jsonObjRoot.get("url").toString());
      }
    } catch (JSONException e) {
      e.printStackTrace();
      // 把错误的json数据写入Log
      log.error("addOneBlog异常,json数据是:" + jsonData);
View Full Code Here

Examples of com.qq.open.qzone.bean.result.QqAddBlogResultBean

    paramBean.setContent("当你能看到这里的时候,就证明我们的JavaSDK2.0版已经成功集成了。热烈鼓掌!!");
   
    QqAddOneBlog bolg = new QqAddOneBlog();
   
    // 调用发布日志方法
    QqAddBlogResultBean resultBean = bolg.addOneBlog(paramBean);
   
    // 接口返回错误的场合
    if (resultBean.getErrorFlg()) {
      System.out.println("接口调用出错啦!!");
      System.out.println("错误编号:" + resultBean.getErrorCode());
      System.out.println("错误信息:" + resultBean.getErrorMes());
    } else {
      System.out.println("成功调用接口!!");
      System.out.println("URL:" + resultBean.getUrl());
    }
    System.exit(0);
  }
View Full Code Here

Examples of com.qq.open.qzone.bean.result.QqAddBlogResultBean

   * @return JavaBean数据
   * @throws JSONException
   */
  private QqAddBlogResultBean jsonToBean(String jsonData) throws JSONException {
    // 接口返回数据Bean
    QqAddBlogResultBean resultBean = new QqAddBlogResultBean();
   
    // 接口返回的数据json
    JSONObject jsonObjRoot = new JSONObject(jsonData);
   
    // 接口返回错误的场合
    if (jsonObjRoot.getInt("ret") != 0) {
      // 设置错误标识为真
      resultBean.setErrorFlg(true);
     
      // 设置错误编号
      resultBean.setErrorCode(jsonObjRoot.get("ret").toString());
     
      // 设置错误信息
      resultBean.setErrorMes(jsonObjRoot.getString("msg"));
    } else {
      resultBean.setUrl(jsonObjRoot.get("url").toString());
    }
   
    return resultBean;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.