批量为用户打上标签
标签功能目前支持公众号为用户打上最多三个标签。
@param openidList 用户openid列表
@param tagId 标签ID
@return 结果
544869
public ResultType batchTagsToUser(List<String> openidList, Integer tagId) {
        BeanUtil.requireNonNull(tagId, "tagId is null");
        if(CollectionUtil.isEmpty(openidList)) {
            throw new WeixinException("openId列表为空");
        }
        LOG.debug("批量为用户打上标签.....");
        String url = BASE_API_URL + "cgi-bin/tags/members/batchtagging?access_token=#";
        Map<String, Object> param = new HashMap<String, Object>();
        param.put("openid_list", openidList);
        param.put("tagid", tagId);
        BaseResponse response = executePost(url, JSONUtil.toJson(param));
        return ResultType.get(response.getErrcode());
    }
912924
public List<User> batchGet(String... openIds) {
        if(openIds.length > 100) {
            throw new WxRuntimeException(999, "批量获取用户基本信息。最多支持一次拉取100条");
        }
        List<Map<String, String>> list = new ArrayList<>();
        for (String openId: openIds) {
            Map<String, String> map = new HashMap<>();
            map.put("openid", openId);
            map.put("lang", "zh_CN");
            list.add(map);
        }
        return batchGet(list);
    }
895241
def change_openid(self, from_appid, openid_list):
        '''
        '''
        return self._post(
            'changeopenid',
            data={'from_appid': from_appid, 'openid_list': openid_list},
            result_processor=lambda x: x['result_list']
        )
419979
public List<OpenIDAttribute> createAttributeList(String identifier) {
		List<OpenIDAttribute> list = new LinkedList<>();
		if (identifier != null && identifier.matches("https://www.google.com/.*")) {
			OpenIDAttribute email = new OpenIDAttribute("email", "http://axschema.org/contact/email");
			OpenIDAttribute first = new OpenIDAttribute("firstname", "http://axschema.org/namePerson/first");
			OpenIDAttribute last = new OpenIDAttribute("lastname", "http://axschema.org/namePerson/last");
			email.setCount(1);
			email.setRequired(true);
			first.setRequired(true);
			last.setRequired(true);
			list.add(email);
			list.add(first);
			list.add(last);
		}
		return list;
	}
1291611
public function MoveUserlistGroup($openid_list, $to_groupid)
    {
        if (!is_array($openid_list)) {
            $this->setError('参数必须为一个数组');

            return false;
        }

        $queryStr = ['openid_list' => $openid_list, 'to_groupid' => $to_groupid];

        $res = $this->_post('members/batchupdate', $queryStr);

        return $res;
    }
542315
public Query getPKQuery(Identity oid)
    {
        Object[] values = oid.getPrimaryKeyValues();
        ClassDescriptor cld = pb.getClassDescriptor(oid.getObjectsTopLevelClass());
        FieldDescriptor[] fields = cld.getPkFields();
        Criteria criteria = new Criteria();

        for (int i = 0; i < fields.length; i++)
        {
            FieldDescriptor fld = fields[i];
            criteria.addEqualTo(fld.getAttributeName(), values[i]);
        }
        return QueryFactory.newQuery(cld.getClassOfObject(), criteria);
    }
418113
public function batch(array $openIdList, int $id)
    {
        return self::$curl->post(self::BATCH_TAG.self::$access_token, json_encode([
                'openid_list' => $openIdList,
                'tagid' => $id,
            ]
        ));
    }
284064
public List<TagCount> getTagsOnSpace(int spaceId) {
		return getResourceFactory()
				.getApiResource("/tag/space/" + spaceId + "/")
				.get(new GenericType<List<TagCount>>() { });
	}
1028766
public QYResultType delete(Integer tagid){
        BeanUtil.requireNonNull(tagid, "tagid不能为空！");
        String url = BASE_API_URL + "cgi-bin/tag/delete?access_token=#&tagid=" + tagid;
        BaseResponse response = executeGet(url);
        return QYResultType.get(response.getErrcode());
    }
177925
function createIDList() {
        var doc = DocumentManager.getCurrentDocument();
        if (!doc) {
            return;
        }

        var idList = [];
        var docText = doc.getText();
        var lines = docText.split("\n");

        var regex = new RegExp(/\s+id\s*?=\s*?["'](.*?)["']/gi);
        var id, chFrom, chTo, i, line;
        for (i = 0; i < lines.length; i++) {
            line = lines[i];
            var info;
            while ((info = regex.exec(line)) !== null) {
                id = info[1];
                // TODO: this doesn't handle id's that share the
                // same portion of a name on the same line or when
                // the id and value are on different lines
                chFrom = line.indexOf(id);
                chTo = chFrom + id.length;
                idList.push(new FileLocation(null, i, chFrom, chTo, id));
            }
        }
        return idList;
    }
62683
public boolean validToken(String token, String openid) {
        BeanUtil.requireNonNull(token, "token is null");
        BeanUtil.requireNonNull(openid, "openid is null");
        String url = BASE_API_URL + "sns/auth?access_token=" + token + "&openid=" + openid;
        BaseResponse r = executeGet(url);
        return isSuccess(r.getErrcode());
    }
1148260
public static int getTagId(String name) {
    int id = -1;
    try {
      if (instance == null)
        getTiffTags();
    } catch (ReadTagsIOException e) {
      /*Nothing to be shown*/
    }
    if (tagNames.containsKey(name))
      id = tagNames.get(name).getId();
    return id;
  }
1025243
public function getCardList($openid, $card_id = null)
    {
        $data = ['openid' => $openid];
        is_null($card_id) || $data['card_id'] = $card_id;
        $url = "https://api.weixin.qq.com/card/user/getcardlist?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, $data);
    }
182890
public function getTagUserList($tagId)
    {
        $result = $this->httpGet(self::WECHAT_TAG_USER_LIST_GET_PREFIX, [
            'access_token' => $this->getAccessToken(),
            'tagid' => $tagId
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'ok' ? $result : $this->dump($result);
    }
35646
public List<TagCount> getTagsOnApp(int appId) {
		return getResourceFactory().getApiResource("/tag/app/" + appId + "/")
				.get(new GenericType<List<TagCount>>() { });
	}
405571
public function getUsers(int $id, string $openId = null)
    {
        return self::$curl->get(self::TAG_USERS.self::$access_token, json_encode(array_filter([
                'tagid' => $id,
                'next_openid' => $openId,
            ]
        )));
    }
952383
public static Id normalize(Id id) {
    return (new DefaultId(id.name())).withTags(id.tags()).normalize();
  }