mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-05-03 12:17:46 +08:00
🎨 #3179 【企业微信】群机器人发送消息接口中增加发送语音类型消息的方法
This commit is contained in:
parent
344263bc5e
commit
1fe8fe4caa
@ -98,6 +98,15 @@ public interface WxCpGroupRobotService {
|
||||
*/
|
||||
void sendFile(String webhookUrl, String mediaId) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 发送文件类型的消息
|
||||
*
|
||||
* @param webhookUrl webhook地址
|
||||
* @param mediaId 语音文件id
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
void sendVoice(String webhookUrl, String mediaId) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 发送模板卡片消息
|
||||
* @param webhookUrl
|
||||
|
@ -92,6 +92,14 @@ public class WxCpGroupRobotServiceImpl implements WxCpGroupRobotService {
|
||||
.setMediaId(mediaId).toJson());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void sendVoice(String webhookUrl, String mediaId) throws WxErrorException {
|
||||
this.cpService.postWithoutToken(webhookUrl, new WxCpGroupRobotMessage()
|
||||
.setMsgType(GroupRobotMsgType.VOICE)
|
||||
.setMediaId(mediaId).toJson());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendTemplateCardMessage(String webhookUrl, WxCpGroupRobotMessage wxCpGroupRobotMessage) throws WxErrorException {
|
||||
this.cpService.postWithoutToken(webhookUrl, wxCpGroupRobotMessage.toJson());
|
||||
|
@ -536,6 +536,11 @@ public class WxCpConsts {
|
||||
*/
|
||||
public static final String FILE = "file";
|
||||
|
||||
/**
|
||||
* 文件类型消息.
|
||||
*/
|
||||
public static final String VOICE = "voice";
|
||||
|
||||
/**
|
||||
* 模版类型消息.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user