Example #1
0
  // TODO-Shunli: now update group always failed, tip system error, check later
  public static JsonRtn updateGroup(License license, Group group) {
    if (group == null) {
      return JsonRtnUtil.buildFailureJsonRtn(JsonRtn.class, "missing group");
    }

    return HttpUtil.postBodyRequest(
        WechatRequest.UPDATE_GROUP, license, new GroupWarpper(group), GroupJsonRtn.class);
  }
Example #2
0
  public static GroupIdJsonRtn getGroupIdByOpenId(License license, String openId) {
    if (StringUtils.isEmpty(openId)) {
      return JsonRtnUtil.buildFailureJsonRtn(GroupIdJsonRtn.class, "missing openId");
    }

    return HttpUtil.postBodyRequest(
        WechatRequest.GET_GROUP_BY_OPEN_ID, license, new OpenId(openId), GroupIdJsonRtn.class);
  }
Example #3
0
  public static JsonRtn moveMember(License license, String openId, int toGroupId) {
    if (StringUtils.isEmpty(openId)) {
      return JsonRtnUtil.buildFailureJsonRtn(JsonRtn.class, "missing openId");
    }

    return HttpUtil.postBodyRequest(
        WechatRequest.MOVE_MEMBER_GROUP,
        license,
        new MemberMovement(openId, toGroupId),
        GroupJsonRtn.class);
  }
Example #4
0
  public static GroupJsonRtn createGroup(License license, String groupName) {
    if (StringUtils.isEmpty(groupName)) {
      return JsonRtnUtil.buildFailureJsonRtn(GroupJsonRtn.class, "missing groupName");
    }

    return HttpUtil.postBodyRequest(
        WechatRequest.CREATE_GROUP,
        license,
        new GroupWarpper(new Group(groupName)),
        GroupJsonRtn.class);
  }
Example #5
0
 public static GroupsJsonRtn getGroups(License license) {
   return HttpUtil.getRequest(WechatRequest.GET_GROUPS, license, GroupsJsonRtn.class);
 }