me.chanjar.weixin.mp.api.WxMpService.getTemplateMsgService()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(311)

本文整理了Java中me.chanjar.weixin.mp.api.WxMpService.getTemplateMsgService()方法的一些代码示例,展示了WxMpService.getTemplateMsgService()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WxMpService.getTemplateMsgService()方法的具体详情如下:
包路径:me.chanjar.weixin.mp.api.WxMpService
类名称:WxMpService
方法名:getTemplateMsgService

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);

相关文章