From c83cf9d2d82a0a29a15e38f4566eb470b9a3517b Mon Sep 17 00:00:00 2001 From: 101captain <237651143@qq.com> Date: 星期二, 22 二月 2022 09:57:51 +0800 Subject: [PATCH] 抽奖相关提交 --- springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/config/WxMaConfiguration.java | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 47 insertions(+), 0 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/config/WxMaConfiguration.java b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/config/WxMaConfiguration.java new file mode 100644 index 0000000..d5faf08 --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/config/WxMaConfiguration.java @@ -0,0 +1,47 @@ +package com.panzhihua.applets.config; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Component; + +import cn.binarywang.wx.miniapp.api.WxMaService; +import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl; +import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl; +import lombok.extern.slf4j.Slf4j; + +/** + * @program: springcloud_k8s_panzhihuazhihuishequ + * @description: wexin + * @author: huang.hongfa weixin hhf9596 qq 959656820 + * @create: 2020-11-23 15:07 + **/ +@Slf4j +@Component +public class WxMaConfiguration { + + @Resource + private WxMaProperties properties; + + @Resource + private WxH5Properties wxH5Properties; + + public WxMaService getMaService() { + WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl(); + config.setAppid(properties.getAppid()); + config.setSecret(properties.getSecret()); + config.setMsgDataFormat(properties.getMsgDataFormat()); + WxMaService wxMaService = new WxMaServiceImpl(); + wxMaService.setWxMaConfig(config); + return wxMaService; + } + + public WxMaService getMaH5Service() { + WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl(); + config.setAppid(wxH5Properties.getAppid()); + config.setSecret(wxH5Properties.getSecret()); + config.setMsgDataFormat(wxH5Properties.getMsgDataFormat()); + WxMaService wxMaService = new WxMaServiceImpl(); + wxMaService.setWxMaConfig(config); + return wxMaService; + } +} -- Gitblit v1.7.1