Package com.belerweb.social.bean

Examples of com.belerweb.social.bean.Error


  public Result<List<com.belerweb.social.weixin.bean.Menu>> get(String accessToken) {
    List<NameValuePair> params = new ArrayList<NameValuePair>();
    weixin.addParameter(params, "access_token", accessToken);
    String json = weixin.get("https://api.weixin.qq.com/cgi-bin/menu/get", params);
    JSONObject jsonObject = new JSONObject(json);
    Error error = Error.parse(jsonObject);
    if (error != null) {
      return new Result<List<com.belerweb.social.weixin.bean.Menu>>(error);
    }
    List<com.belerweb.social.weixin.bean.Menu> menus =
        new ArrayList<com.belerweb.social.weixin.bean.Menu>();
View Full Code Here


    connect.addParameter(params, "access_token", accessToken);
    connect.addParameter(params, "openid", openid);
    connect.addParameter(params, "format", "json");
    String json = connect.get("https://graph.qq.com/photo/list_album", params);
    JSONObject jsonObject = new JSONObject(json);
    Error error = Error.parse(jsonObject);
    if (error != null) {
      return new Result<Album>(error);
    }
    List<Album> results = new ArrayList<Album>();
    JSONArray jsonArray = jsonObject.getJSONArray("album");
View Full Code Here

    connect.addParameter(params, "format", "json");
    connect.addParameter(params, "albumid", albumId);
    String json = connect.get("https://graph.qq.com/photo/list_photo", params);

    JSONObject jsonObject = new JSONObject(json);
    Error error = Error.parse(jsonObject);
    if (error != null) {
      return new Result<Photo>(error);
    }
    List<Photo> results = new ArrayList<Photo>();
    JSONArray jsonArray = jsonObject.getJSONArray("photos");
View Full Code Here

    if (compatible != null) {
      addParameter(params, "compatibleflag", compatible ? "0" : "0x20");
    }
    addParameter(params, "format", "json");
    JSONObject jsonObject = new JSONObject(post("https://graph.qq.com/t/add_t", params));
    Error error = Error.parse(jsonObject);
    if (error != null) {
      return new Result<NewT>(error);
    }
    return Result.parse(jsonObject.getJSONObject("data"), NewT.class);
  }
View Full Code Here

    request.setEntity(builder.build());
    try {
      HttpResponse response = Http.CLIENT.execute(request);
      String json = IOUtils.toString(response.getEntity().getContent());
      JSONObject jsonObject = new JSONObject(json);
      Error error = Error.parse(jsonObject);
      if (error != null) {
        return new Result<NewT>(error);
      }
      return Result.parse(jsonObject.getJSONObject("data"), NewT.class);
    } catch (ClientProtocolException e) {
View Full Code Here

    addParameter(params, "limit", limit == null ? "5" : limit);
    addParameter(params, "ver", "1");
    addParameter(params, "format", "json");
    JSONObject jsonObject =
        new JSONObject(post("https://graph.qq.com/cft_info/get_tenpay_addr", params));
    Error error = Error.parse(jsonObject);
    if (error != null) {
      return new Result<List<TenpayAddress>>(error);
    }
    List<TenpayAddress> addresses = new ArrayList<TenpayAddress>();
    Integer total = Result.parseInteger(jsonObject.get("ret_num"));
View Full Code Here

  public Result<List<com.belerweb.social.weixin.bean.Menu>> get(String accessToken) {
    List<NameValuePair> params = new ArrayList<NameValuePair>();
    weixin.addParameter(params, "access_token", accessToken);
    String json = weixin.get("https://api.weixin.qq.com/cgi-bin/menu/get", params);
    JSONObject jsonObject = new JSONObject(json);
    Error error = Error.parse(jsonObject);
    if (error != null) {
      return new Result<List<com.belerweb.social.weixin.bean.Menu>>(error);
    }
    List<com.belerweb.social.weixin.bean.Menu> menus =
        new ArrayList<com.belerweb.social.weixin.bean.Menu>();
View Full Code Here

    connect.addParameter(params, "access_token", accessToken);
    connect.addParameter(params, "openid", openid);
    connect.addParameter(params, "format", "json");
    String json = connect.get("https://graph.qq.com/photo/list_album", params);
    JSONObject jsonObject = new JSONObject(json);
    Error error = Error.parse(jsonObject);
    if (error != null) {
      return new Result<Album>(error);
    }
    List<Album> results = new ArrayList<Album>();
    JSONArray jsonArray = jsonObject.getJSONArray("album");
View Full Code Here

    connect.addParameter(params, "format", "json");
    connect.addParameter(params, "albumid", albumId);
    String json = connect.get("https://graph.qq.com/photo/list_photo", params);

    JSONObject jsonObject = new JSONObject(json);
    Error error = Error.parse(jsonObject);
    if (error != null) {
      return new Result<Photo>(error);
    }
    List<Photo> results = new ArrayList<Photo>();
    JSONArray jsonArray = jsonObject.getJSONArray("photos");
View Full Code Here

    connect.addParameter(params, "access_token", accessToken);
    connect.addParameter(params, "openid", openid);
    connect.addParameter(params, "format", "json");
    String json = connect.get("https://graph.qq.com/user/get_info", params);
    JSONObject jsonObject = new JSONObject(json);
    Error error = Error.parse(jsonObject);
    if (error != null) {
      return new Result<WeiboUser>(error);
    }
    return Result.parse(jsonObject.getJSONObject("data"), WeiboUser.class);
  }
View Full Code Here

TOP

Related Classes of com.belerweb.social.bean.Error

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.