群发图文消息给指定的人

@param openIds
@param mpNews
@return
350037
public long mpNews(List<String> openIds, String mpNews) {
		return send(new Filter(false, null), openIds, "mpnews", mpNews);
	}
813194
public static DelegatedLoopResources newServerLoopResources(EventLoopGroup workerGroup) {
    EventLoopGroup bossGroup =
        Epoll.isAvailable()
            ? new EpollEventLoopGroup(BOSS_THREADS_NUM, BOSS_THREAD_FACTORY)
            : new NioEventLoopGroup(BOSS_THREADS_NUM, BOSS_THREAD_FACTORY);
    return new DelegatedLoopResources(bossGroup, workerGroup);
  }
1210493
private Set<String> getNewSelections(final Request request) {

		// Check for any selections on the request
		String[] paramValue = request.getParameterValues(getId());
		String[] selectedRowIds = removeEmptyStrings(paramValue);
		if (selectedRowIds == null || selectedRowIds.length == 0) {
			return Collections.EMPTY_SET;
		}

		Set<String> newSelectionIds = new HashSet<>();

		boolean singleSelect = getSelectMode() == SelectMode.SINGLE;

		int offset = getItemIdPrefix().length();
		for (String selectedRowId : selectedRowIds) {
			if (selectedRowId.length() <= offset) {
				LOG.warn("Selected row id [" + selectedRowId + "] does not have a valid prefix and will be ignored.");
				continue;
			}
			String itemId = selectedRowId.substring(offset);
			if (isValidTreeItem(itemId)) {
				newSelectionIds.add(itemId);
				if (singleSelect) {
					break;
				}
			} else {
				LOG.warn("Selected row id [" + itemId + "] is not valid and will be ignored.");
			}
		}

		return newSelectionIds;
	}
806033
List<List<TaskId>> interleaveTasksByGroupId(final Collection<TaskId> taskIds, final int numberThreads) {
    final LinkedList<TaskId> sortedTasks = new LinkedList<>(taskIds);
    Collections.sort(sortedTasks);
    final List<List<TaskId>> taskIdsForConsumerAssignment = new ArrayList<>(numberThreads);
    for (int i = 0; i < numberThreads; i++) {
      taskIdsForConsumerAssignment.add(new ArrayList<>());
    }
    while (!sortedTasks.isEmpty()) {
      for (final List<TaskId> taskIdList : taskIdsForConsumerAssignment) {
        final TaskId taskId = sortedTasks.poll();
        if (taskId == null) {
          break;
        }
        taskIdList.add(taskId);
      }
    }
    return taskIdsForConsumerAssignment;
  }
1336774
public static OSMFileHeader create(long id, XMLStreamReader parser) throws XMLStreamException {
        OSMFileHeader header = new OSMFileHeader();
        parser.nextTag();
        return header;
    }
1281985
public function batchTagging(array $openids, $tagId)
    {
        $url = 'https://api.weixin.qq.com/cgi-bin/tags/members/batchtagging?access_token=ACCESS_TOKEN';
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['openid_list' => $openids, 'tagid' => $tagId]);
    }
444300
public static UniversalIdIntQueueMessage newInstance(Long id, byte[] content) {
        UniversalIdIntQueueMessage msg = newInstance(content);
        msg.setId(id);
        return msg;
    }
683050
public UserPagination list(String nextOpenId){
        String url = WxEndpoint.get("url.blacklist.list");
        Map<String, Object> body = new HashMap<>();
        body.put("begin_openid", nextOpenId);
        logger.debug("list all black list: {}", nextOpenId);
        String response = wxClient.post(url, JsonMapper.defaultMapper().toJson(body));
        return JsonMapper.defaultMapper().fromJson(response, UserPagination.class);
    }
367472
public Broadcast getBroadcast(String broadcastId) throws OpenTokException {
        if(StringUtils.isEmpty(broadcastId)) {
            throw new InvalidArgumentException("Broadcast id is null or empty");
        }
        String stream = this.client.getBroadcast(broadcastId);
        try {
            return broadcastReader.readValue(stream);
        } catch (Exception e) {
            throw new RequestException("Exception mapping json: " + e.getMessage());
        }
    }
233972
public <P extends ParaObject> List<P> findByIds(List<String> ids) {
		MultivaluedMap<String, String> params = new MultivaluedHashMap<>();
		params.put("ids", ids);
		return getItems(find("ids", params));
	}
451226
@Deprecated
    public GetSendMessageResponse sendMessageToUser(BaseMsg message, boolean isToAll, String groupId, String[] openIds){
        BeanUtil.requireNonNull(message, "message is null");
        LOG.debug("群发消息......");
        String url = BASE_API_URL + "cgi-bin/message/mass/sendall?access_token=#";
        final Map<String, Object> params = new HashMap<String, Object>();
        Map<String, Object> filterMap = new HashMap<String, Object>();
        filterMap.put("is_to_all", isToAll);
        if(!isToAll){
            BeanUtil.requireNonNull(groupId, "groupId is null");
            filterMap.put("group_id", groupId);
        }
        params.put("filter", filterMap);
        if(message instanceof MpNewsMsg){
            params.put("msgtype", "mpnews");
            MpNewsMsg msg = (MpNewsMsg)message;
            Map<String, Object> mpNews = new HashMap<String, Object>();
            mpNews.put("media_id", msg.getMediaId());
            params.put("mpnews", mpNews);
        }else if(message instanceof TextMsg){
            params.put("msgtype", "text");
            TextMsg msg = (TextMsg)message;
            Map<String ,Object> text = new HashMap<String, Object>();
            text.put("content", msg.getContent());
            params.put("text", text);
        }else if(message instanceof VoiceMsg){
            params.put("msgtype", "voice");
            VoiceMsg msg = (VoiceMsg)message;
            Map<String, Object> voice = new HashMap<String ,Object>();
            voice.put("media_id", msg.getMediaId());
            params.put("voice", voice);
        }else if(message instanceof ImageMsg){
            params.put("msgtype", "image");
            ImageMsg msg = (ImageMsg)message;
            Map<String, Object> image = new HashMap<String, Object>();
            image.put("media_id", msg.getMediaId());
            params.put("image", image);
        }else if(message instanceof VideoMsg){
            // TODO 此处方法特别
        }
        BaseResponse response = executePost(url, JSONUtil.toJson(params));
        String resultJson = isSuccess(response.getErrcode()) ? response.getErrmsg() : response.toJsonString();
        return JSONUtil.toBean(resultJson, GetSendMessageResponse.class);
    }
137396
public static byte[] getIids(final List<String> ids, final UniqueIds uids) {
        final int size = ids.size();
        final byte[] iids = new byte[IID_WIDTH * size];
        for (int i = 0; i < size; i++) {
            final String instanceId = ids.get(i);
            final byte[] iid = uids.getUiid().getId(instanceId);
            System.arraycopy(iid, 0, iids, i * IID_WIDTH, IID_WIDTH);
        }
        return iids;
    }
710928
public <T extends MPBase> T getById(String id) throws MPException {
        T resource = null;
        for (int i = 0; i < _resourceArray.size(); i++) {
            resource = getByIndex(i);
            try {
                Field field = resource.getClass().getDeclaredField("id");
                field.setAccessible(true);
                String resourceId = field.get(resource).toString();
                if (resourceId.equals(id)) {
                    break;
                }
            } catch (Exception exception) {
                throw new MPException(exception);
            }
        }
        return resource;
    }
817897
public void black(List<String> openids) {
        String url = WxEndpoint.get("url.blacklist.black");
        Map<String, Object> body = new HashMap<>();
        body.put("opened_list", openids);
        logger.debug("black users: {}", openids);
        wxClient.post(url, JsonMapper.defaultMapper().toJson(body));
    }
1046906
public void setSnapshotIds(java.util.Collection<String> snapshotIds) {
        if (snapshotIds == null) {
            this.snapshotIds = null;
            return;
        }

        this.snapshotIds = new com.amazonaws.internal.SdkInternalList<String>(snapshotIds);
    }
887122
private Object readNewString(boolean unshared) throws IOException {
        Object result = input.readUTF();
        if (enableResolve) {
            result = resolveObject(result);
        }
        registerObjectRead(result, nextHandle(), unshared);

        return result;
    }
1223976
public function sendGraphTextByOpenid(array $toUsers, $media_id, $title = "", $description = "", $send_ignore_reprint = 1, $clientmsgid = '')
    {
        $ret = array();
        $ret['touser'] = $toUsers;
        $ret['msgtype'] = 'mpnews';
        $ret['mpnews']['media_id'] = $media_id;
        $ret['mpnews']['title'] = $title;
        $ret['mpnews']['description'] = $description;
        $ret['send_ignore_reprint'] = $send_ignore_reprint;
        $ret['clientmsgid'] = $clientmsgid;
        return $this->send($ret);
    }