客服发送文本消息

@param openId
@param text
@param from   客服账号
518234
public void text(String openId, String text, String from) {
        Map<String, Object> request = initMessage(openId, "text", from);
        request.put("text", new Text(text));

        String url = WxEndpoint.get("url.care.message.send");
        wxClient.post(url, JsonMapper.defaultMapper().toJson(request));
    }
832937
private function encrypt($text, $appId)
    {
        try {
            //获得16位随机字符串，填充到明文之前
            $random = $this->getRandomStr();
            $text   = $random.pack('N', strlen($text)).$text.$appId;

            // 网络字节序
            // $size   = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
            $module = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_CBC, '');
            $iv     = substr($this->AESKey, 0, 16);

            //使用自定义的填充方式对明文进行补位填充
            $text   = $this->encode($text);

            mcrypt_generic_init($module, $this->AESKey, $iv);

            //加密
            $encrypted = mcrypt_generic($module, $text);
            mcrypt_generic_deinit($module);
            mcrypt_module_close($module);

            //使用BASE64对加密后的字符串进行编码
            return base64_encode($encrypted);
        } catch (Exception $e) {
            throw new Exception($e->getMessage(), self::ERROR_ENCRYPT_AES);
        }
    }
845955
public void setText(String text) {

        m_text = text;
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(text)) {
            setQuery(createTextQuery(text));
        }
    }
1176401
public void card(String openId, String cardId, String from) {
        Map<String, Object> request = initMessage(openId, "wxcard", from);
        request.put("wxcard", new Card(cardId));

        String url = WxEndpoint.get("url.care.message.send");
        wxClient.post(url, JsonMapper.defaultMapper().toJson(request));
    }
1104370
public OvhDocument document_id_GET(String id) throws IOException {
		String qPath = "/me/document/{id}";
		StringBuilder sb = path(qPath, id);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhDocument.class);
	}
1121190
public long textPreview(String wxName, String openId, String text) {
		return preview(wxName, openId, "text", text);
	}
369541
public void entityRef(String text) throws IOException {
		if (startTagIncomplete || setPrefixCalled || seenBracket)
			closeStartTag();
		if (doIndent && seenTag)
			seenTag = false;
		out.write('&');
		out.write(text); // escape?
		out.write(';');
	}
1286995
public function messageCustomSend($openid, $content, $type = self::MSG_TYPE_TEXT){

        //基础数据
        $data = array(
            'touser'=>$openid,
            'msgtype'=>$type,
        );

        //根据类型附加额外数据
        $data[$type] = call_user_func(array(self, $type), $content);

        return $this->api('message/custom/send', $data);
    }
392985
public void document_id_PUT(String id, OvhDocument body) throws IOException {
		String qPath = "/me/document/{id}";
		StringBuilder sb = path(qPath, id);
		exec(qPath, "PUT", sb.toString(), body);
	}
1012778
public int addReply(int conversationId, String text) {
		return getResourceFactory()
				.getApiResource("/conversation/" + conversationId + "/reply")
				.entity(new MessageCreate(text),
						MediaType.APPLICATION_JSON_TYPE)
				.get(MessageCreateResponse.class).getMessageId();
	}
749670
public static UniversalIdStrQueueMessage newInstance(String id, String content) {
        UniversalIdStrQueueMessage msg = newInstance(content);
        msg.setId(id);
        return msg;
    }
139192
public void setId(String id) {
      if (StringUtils.isNullOrBlank(id)) {
         this.id = UUID.randomUUID().toString();
      } else {
         this.id = id;
      }
   }
1029682
public void setText(String text) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
      if ((text == null) || text.length() < 257) {
        SibTr.entry(this, tc, "setText", text);
      }
      else {
        SibTr.entry(this, tc, "setText", new Object[]{text.length(), text.substring(0,200)+"..."});
      }
    }

    // If the payload is changing, we need to clear all the cached values.
    softRefToDocument = null;
    clearCachedLengths();

    // Set the payload data
    getPayload().setField(JmsTextBodyAccess.BODY_DATA_VALUE, text);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setText");
  }
1265496
public static Message create(final String to, final String from, final String text) throws Exception {
    	
    	final Map<String, Object> params = new HashMap<String, Object>();
    	params.put("to", to);
    	params.put("from", from);
    	params.put("text", text);
    	
    	return create(params);
    }
1151290
@Override public boolean send(String text) {
    if (text == null) throw new NullPointerException("text == null");
    return send(ByteString.encodeUtf8(text), OPCODE_TEXT);
  }
29418
public void setUserDefinedText(String desc, String text)
	{
		if (allow(ID3V2))
		{
			id3v2.setUserDefinedTextFrame(desc, text);
		}
	}
1264151
public String getGroupIdByOpenid(String openid) {
        BeanUtil.requireNonNull(openid, "openid is null");
        LOG.debug("通过关注者ID获取所在分组信息.....");
        String result = null;
        String url = BASE_API_URL + "cgi-bin/groups/getid?access_token=#";
        Map<String, String> params = new HashMap<String, String>();
        params.put("openid", openid);
        BaseResponse r = executePost(url, JSONUtil.toJson(params));
        if (isSuccess(r.getErrcode())) {
            result = JSONUtil.toMap(r.getErrmsg()).get("groupid").toString();
        }
        return result;
    }