| | |
| | | import cn.binarywang.wx.miniapp.bean.WxMaMessage; |
| | | import cn.binarywang.wx.miniapp.config.WxMaInMemoryConfig; |
| | | import cn.binarywang.wx.miniapp.message.WxMaMessageRouter; |
| | | import cn.huge.module.oper.dto.SeCustWechatDTO; |
| | | import cn.huge.module.wechat.miniapp.handler.*; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | |
| | | /** |
| | | * @title: 小程序服务 |
| | |
| | | // this.refreshRouter(); |
| | | // } |
| | | |
| | | public void createConfig(SeCustWechatDTO seCustWechatDTO) { |
| | | final WxMaInMemoryConfig config = new WxMaInMemoryConfig(); |
| | | config.setAppid(seCustWechatDTO.getAppid());// 设置微信公众号的appid |
| | | config.setSecret(seCustWechatDTO.getSecret());// 设置微信公众号的app corpSecret |
| | | config.setToken(seCustWechatDTO.getToken());// 设置微信公众号的token |
| | | config.setAesKey(seCustWechatDTO.getAeskey());// 设置消息加解密密钥 |
| | | super.setWxMaConfig(config); |
| | | |
| | | this.refreshRouter(); |
| | | } |
| | | |
| | | private void refreshRouter() { |
| | | final WxMaMessageRouter newRouter = new WxMaMessageRouter(this); |
| | | |