Esempio n. 1
0
  /**
   * UnFollow user
   *
   * @param tag
   * @param id
   * @param listener
   * @param errorListener
   */
  public static void unFollowUser(
      Object tag, final int id, Response.Listener listener, Response.ErrorListener errorListener) {
    Request request =
        new AuthedGsonRequest<User>(
            Request.Method.POST,
            HttpUtil.getUserByIdWithOp(id, HttpUtil.UserOp.UNFOLLOW, null, 0),
            User.class,
            listener,
            errorListener);

    addToRequestQueue(tag, request);
  }
Esempio n. 2
0
  /**
   * Get the profile of current user
   *
   * @param tag
   * @param listener
   * @param errorListener
   */
  public static void getProfile(
      Object tag, Response.Listener listener, Response.ErrorListener errorListener) {
    Request request =
        new AuthedGsonRequest<User>(
            Request.Method.GET,
            HttpUtil.getProfileWithOp(HttpUtil.ProfileOp.DETAIL),
            User.class,
            listener,
            errorListener);

    addToRequestQueue(tag, request);
  }
Esempio n. 3
0
  /**
   * Get the user favorite organization list
   *
   * @param tag
   * @param id
   * @param listener
   * @param errorListener
   */
  public static void getUserFOrganization(
      Object tag, final int id, Response.Listener listener, Response.ErrorListener errorListener) {
    Request request =
        new AuthedGsonRequest<Organization.OrganizationRequestData>(
            Request.Method.GET,
            HttpUtil.getUserByIdWithOp(id, HttpUtil.UserOp.FORGANIZATION, null, 0),
            Organization.OrganizationRequestData.class,
            listener,
            errorListener);

    addToRequestQueue(tag, request);
  }
Esempio n. 4
0
  /**
   * Get the user information by id
   *
   * @param tag
   * @param id
   * @param listener
   * @param errorListener
   */
  public static void getUserInfoById(
      Object tag, final int id, Response.Listener listener, Response.ErrorListener errorListener) {
    Request request =
        new AuthedGsonRequest<User>(
            Request.Method.GET,
            HttpUtil.getUserByIdWithOp(id, HttpUtil.UserOp.DETAIL, null, 0),
            User.class,
            listener,
            errorListener);

    addToRequestQueue(tag, request);
  }
Esempio n. 5
0
  /**
   * Get the organization fans list
   *
   * @param tag
   * @param id
   * @param listener
   * @param errorListener
   */
  public static void getOrganizationFans(
      Object tag, final int id, Response.Listener listener, Response.ErrorListener errorListener) {
    Request request =
        new GsonRequest<OrgFans.RequestData>(
            Request.Method.GET,
            HttpUtil.getOrganizationByIdWithOp(id, HttpUtil.OrganizationOp.FANS, 0, null),
            OrgFans.RequestData.class,
            listener,
            errorListener);

    addToRequestQueue(tag, request);
  }
Esempio n. 6
0
  /**
   * Get the user favorite activity list
   *
   * @param tag
   * @param id
   * @param listener
   * @param errorListener
   */
  public static void getUserFActivity(
      Object tag, final int id, Response.Listener listener, Response.ErrorListener errorListener) {
    Request request =
        new AuthedGsonRequest(
            Request.Method.GET,
            HttpUtil.getUserByIdWithOp(id, HttpUtil.UserOp.FACTIVITY, null, 0),
            ActivityList.RequestData.class,
            listener,
            errorListener);

    addToRequestQueue(tag, request);
  }
Esempio n. 7
0
  /**
   * Get the friends list
   *
   * @param tag
   * @param id
   * @param listener
   * @param errorListener
   */
  public static void getFriends(
      Object tag, final int id, Response.Listener listener, Response.ErrorListener errorListener) {
    Request request =
        new AuthedGsonRequest(
            Request.Method.GET,
            HttpUtil.getUserByIdWithOp(id, HttpUtil.UserOp.FRIENDS, null, 0),
            User.UserListData.class,
            listener,
            errorListener);

    addToRequestQueue(tag, request);
  }
Esempio n. 8
0
  /**
   * Get Activity Category
   *
   * @param tag
   * @param listener
   * @param errorListener
   */
  public static void getActivityCategory(
      Object tag, Response.Listener listener, Response.ErrorListener errorListener) {
    Request request =
        new GsonRequest<ActivityCategory.CategoryRequestData>(
            Request.Method.GET,
            HttpUtil.getActivityCategory(),
            ActivityCategory.CategoryRequestData.class,
            listener,
            errorListener);

    addToRequestQueue(tag, request);
  }
Esempio n. 9
0
  /**
   * Unfollow the organization
   *
   * @param tag
   * @param id
   * @param listener
   * @param errorListener
   */
  public static void unfollowOrganization(
      Object tag, final int id, Response.Listener listener, Response.ErrorListener errorListener) {
    Request request =
        new AuthedGsonRequest(
            Request.Method.POST,
            HttpUtil.getOrganizationByIdWithOp(id, HttpUtil.OrganizationOp.UNFOLLOW, 0, null),
            Organization.class,
            listener,
            errorListener);

    addToRequestQueue(tag, request);
  }
Esempio n. 10
0
  /**
   * QUIT ACTIVITY
   *
   * @param tag
   * @param id
   * @param listener
   * @param errorListener
   */
  public static void quitActivityWithId(
      Object tag, final int id, Response.Listener listener, Response.ErrorListener errorListener) {
    Request request =
        new AuthedGsonRequest<Activity>(
            Request.Method.POST,
            HttpUtil.getActivityByIdWithOp(id, HttpUtil.ActivityOp.QUIT, 0),
            Activity.class,
            listener,
            errorListener);

    addToRequestQueue(tag, request);
  }
Esempio n. 11
0
  /**
   * GET ACTIVITY LIST
   *
   * @param page
   * @param listener
   * @param errorListener
   */
  public static void getActivityList(
      Object tag,
      final int page,
      Response.Listener listener,
      Response.ErrorListener errorListener) {
    Request request =
        new AuthedGsonRequest<Activity.ActivityRequestData>(
            Request.Method.GET,
            HttpUtil.getActivityByIdWithOp(0, HttpUtil.ActivityOp.LIST, page),
            Activity.ActivityRequestData.class,
            listener,
            errorListener);

    addToRequestQueue(tag, request);
  }
Esempio n. 12
0
  public static void searchActivity(
      Object tag,
      int page,
      String keywords,
      Response.Listener listener,
      Response.ErrorListener errorListener) {
    Request request =
        new GsonRequest(
            Request.Method.GET,
            HttpUtil.searchActivityByKeywords(keywords, page),
            ActivityList.RequestData.class,
            listener,
            errorListener);

    addToRequestQueue(tag, request);
  }
Esempio n. 13
0
  /**
   * Get the activity of one category
   *
   * @param tag
   * @param page
   * @param category
   * @param listener
   * @param errorListener
   */
  public static void getActivityOfCategory(
      Object tag,
      final int page,
      final String category,
      Response.Listener listener,
      Response.ErrorListener errorListener) {
    Request request =
        new GsonRequest<Activity.ActivityRequestData>(
            Request.Method.GET,
            HttpUtil.getActivityOfCategory(category, page),
            Activity.ActivityRequestData.class,
            listener,
            errorListener);

    addToRequestQueue(tag, request);
  }
Esempio n. 14
0
  /**
   * Get the organization's activities
   *
   * @param tag
   * @param id
   * @param page
   * @param listener
   * @param errorListener
   */
  public static void getOrganizationActivity(
      Object tag,
      final int id,
      final int page,
      Response.Listener listener,
      Response.ErrorListener errorListener) {
    Request request =
        new GsonRequest<ActivityList.RequestData>(
            Request.Method.GET,
            HttpUtil.getOrganizationByIdWithOp(id, HttpUtil.OrganizationOp.ACTIVITY, page, null),
            ActivityList.RequestData.class,
            listener,
            errorListener);

    addToRequestQueue(tag, request);
  }
Esempio n. 15
0
  /**
   * Get Activity Participants with id
   *
   * @param tag
   * @param id
   * @param listener
   * @param errorListener
   */
  public static void getActivityParticipantsWithId(
      Object tag,
      final int id,
      int page,
      Response.Listener listener,
      Response.ErrorListener errorListener) {
    Request request =
        new AuthedGsonRequest<User.UserListData>(
            Request.Method.GET,
            HttpUtil.getActivityByIdWithOp(id, HttpUtil.ActivityOp.PARTICIPATE, page),
            User.UserListData.class,
            listener,
            errorListener);

    addToRequestQueue(tag, request);
  }
Esempio n. 16
0
  public static void searchOrgs(
      Object tag,
      int page,
      String keywords,
      Response.Listener listener,
      Response.ErrorListener errorListener) {
    Request request =
        new GsonRequest(
            Request.Method.GET,
            HttpUtil.getOrganizationByIdWithOp(0, HttpUtil.OrganizationOp.SEARCH, page, keywords),
            Organization.OrganizationRequestData.class,
            listener,
            errorListener);

    addToRequestQueue(tag, request);
  }
Esempio n. 17
0
  public static void searchUser(
      Object tag,
      int page,
      String keywords,
      Response.Listener listener,
      Response.ErrorListener errorListener) {
    Request request =
        new GsonRequest(
            Request.Method.GET,
            HttpUtil.getUserByIdWithOp(0, HttpUtil.UserOp.SEARCH, keywords, page),
            User.UserListData.class,
            listener,
            errorListener);

    addToRequestQueue(tag, request);
  }
Esempio n. 18
0
  /**
   * 获取关注列表
   *
   * @param tag
   * @param id
   * @param listener
   * @param errorListener
   */
  public static void getFollowers(
      Object tag,
      int id,
      int page,
      Response.Listener listener,
      Response.ErrorListener errorListener) {
    Request request =
        new GsonRequest(
            Request.Method.GET,
            HttpUtil.getUserByIdWithOp(id, HttpUtil.UserOp.FOLLOWERS, null, page),
            User.UserListData.class,
            listener,
            errorListener);

    addToRequestQueue(tag, request);
  }