本文整理了Java中me.chanjar.weixin.mp.api.WxMpService.getTemplateMsgService()
方法的一些代码示例,展示了WxMpService.getTemplateMsgService()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WxMpService.getTemplateMsgService()
方法的具体详情如下:
包路径:me.chanjar.weixin.mp.api.WxMpService
类名称:WxMpService
方法名:getTemplateMsgService
[英]返回模板消息相关接口方法的实现类对象,以方便调用其各个接口.
[中]返回模板消息相关接口方法的实现类对象,以方便调用其各个接口.
代码示例来源:origin: com.github.hippoom/wechat-mp-autoconfigure
/**
* Default {@link WxMpTemplateMsgService} provider.
*
* @param wxMpService {@link WxMpService}
* @return {@link WxMpTemplateMsgService}
*
* @see WxMpTemplateMsgService
*/
@Bean
protected WxMpTemplateMsgService wxMpTemplateMsgService(WxMpService wxMpService) {
return wxMpService.getTemplateMsgService();
}
代码示例来源:origin: liuweijw/fw-cloud-framework
String returnMsg = wxMpService.getTemplateMsgService().sendTemplateMsg(toMessage);
log.info("|send template msg end |" + returnMsg);
代码示例来源:origin: sqmax/springboot-project
@Override
public void orderStatus(OrderDTO orderDTO) {
WxMpTemplateMessage templateMessage=new WxMpTemplateMessage();
templateMessage.setTemplateId(accountConfig.getTemplateId().get("orderStatus"));//模板id:"GoCullfix05R-rCibvoyI87ZUg50cyieKA5AyX7pPzo"
templateMessage.setToUser(orderDTO.getBuyerOpenid());//openid:"ozswp1Ojl2rA57ZK97ntGw2WQ2CA"
List<WxMpTemplateData> data= Arrays.asList(
new WxMpTemplateData("first","亲,记得收货"),
new WxMpTemplateData("keyword1","微信点餐"),
new WxMpTemplateData("keyword2","15712363915"),
new WxMpTemplateData("keyword3",orderDTO.getOrderId()),
new WxMpTemplateData("keyword4",orderDTO.getOrderStatusEnum().getMessage()),
new WxMpTemplateData("keyword5","¥"+orderDTO.getOrderAmount()),
new WxMpTemplateData("remark","欢迎再次光临"));
templateMessage.setData(data);
try {
wxMpService.getTemplateMsgService().sendTemplateMsg(templateMessage);
}catch (WxErrorException e){
log.error("【微信模板消息】发送失败,{}",e);
}
}
}
代码示例来源:origin: linxinzhe/java-springboot-sell
@Override
public void orderStatus(OrderDTO orderDTO) {
WxMpTemplateMessage templateMessage = new WxMpTemplateMessage();
templateMessage.setTemplateId(accountConfig.getTemplateId().get("orderStatus"));
templateMessage.setToUser(orderDTO.getBuyerOpenid());
List<WxMpTemplateData> data = Arrays.asList(
new WxMpTemplateData("first", "亲,记得收货"),
new WxMpTemplateData("keyword1", "微信点餐"),
new WxMpTemplateData("keyword2", "13835433112"),
new WxMpTemplateData("keyword3", orderDTO.getOrderId()),
new WxMpTemplateData("keyword4", orderDTO.getOrderId()),
new WxMpTemplateData("keyword5", "¥" + orderDTO.getOrderAmount()),
new WxMpTemplateData("remark", "欢迎再次光临")
);
templateMessage.setData(data);
try {
wxMpService.getTemplateMsgService().sendTemplateMsg(templateMessage);
} catch (WxErrorException e) {
log.error("【微信模板消息】发送失败,{}", e);
}
}
}
代码示例来源:origin: liuweijw/fw-cloud-framework
String returnMsg = wxMpService.getTemplateMsgService().sendTemplateMsg(toMessage);
log.info("|send template msg end |" + returnMsg);
内容来源于网络,如有侵权,请联系作者删除!