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


  public Result<List<com.belerweb.social.weixin.bean.Group>> 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/groups/get", params);
    JSONObject jsonObject = new JSONObject(json);
    Error error = Error.parse(jsonObject);
    if (error == null) {
      List<com.belerweb.social.weixin.bean.Group> groups =
          Result.parse(jsonObject.getJSONArray("groups"),
              com.belerweb.social.weixin.bean.Group.class);
      return new Result<List<com.belerweb.social.weixin.bean.Group>>(groups);
View Full Code Here

      String json =
          weixin.post(
              "https://api.weixin.qq.com/cgi-bin/groups/create?access_token=" + accessToken,
              new StringEntity(request.toString()));
      JSONObject jsonObject = new JSONObject(json);
      Error error = Error.parse(jsonObject);
      if (error != null) {
        return new Result<com.belerweb.social.weixin.bean.Group>(error);
      }
      return new Result<com.belerweb.social.weixin.bean.Group>(
          com.belerweb.social.weixin.bean.Group.parse(jsonObject.getJSONObject("group")));
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<com.belerweb.social.weixin.bean.Media>(error);
      }
      media.setId(jsonObject.getString("media_id"));
      return new Result<com.belerweb.social.weixin.bean.Media>(media);
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.