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

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

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

WxMpService.setWxMpConfigStorage介绍

[英]注入 WxMpConfigStorage 的实现
[中]注入 WxMpConfigStorage的实现

代码示例

代码示例来源:origin: liuweijw/fw-cloud-framework

@Bean
@ConditionalOnMissingBean
public WxMpService wxMpService(WxMpConfigStorage configStorage) {
  // WxMpService wxMpService = new me.chanjar.weixin.mp.api.impl.okhttp.WxMpServiceImpl();
  // WxMpService wxMpService = new me.chanjar.weixin.mp.api.impl.jodd.WxMpServiceImpl();
  // WxMpService wxMpService = new me.chanjar.weixin.mp.api.impl.apache.WxMpServiceImpl();
  WxMpService wxMpService = new me.chanjar.weixin.mp.api.impl.WxMpServiceImpl();
  wxMpService.setWxMpConfigStorage(configStorage);
  return wxMpService;
}

代码示例来源:origin: lord-of-code/loc-framework

@Bean
 @ConditionalOnMissingBean
 public WxMpService wxMpService(WxMpConfigStorage configStorage) {
  WxMpService wxMpService = new WxMpServiceOkHttpImpl();
  wxMpService.setWxMpConfigStorage(configStorage);
  return wxMpService;
 }
}

代码示例来源:origin: lord-of-code/loc-framework

@Bean
 @ConditionalOnMissingBean
 public WxMpService wxMpService(WxMpConfigStorage configStorage) {
  WxMpService wxMpService = new WxMpServiceOkHttpImpl();
  wxMpService.setWxMpConfigStorage(configStorage);
  return wxMpService;
 }
}

代码示例来源:origin: com.github.hippoom/wechat-mp-autoconfigure

/**
 * Default {@link WxMpService}, you can provide a custom instance, see <a
 * href="https://github.com/Hippoom/wechat-mp-starter/wiki/Autowiring-WxMpService">wiki</a>
 * for detail.
 *
 * @param wxMpConfigStorage {@link WxMpConfigStorage}
 * @return {@link WxMpService}
 *
 * @see WxMpService
 */
@Bean
@ConditionalOnMissingBean
protected WxMpService wxMpService(WxMpConfigStorage wxMpConfigStorage) {
  WxMpService wxMpService = new WxMpServiceImpl();
  wxMpService.setWxMpConfigStorage(wxMpConfigStorage);
  return wxMpService;
}

代码示例来源:origin: yjjdick/sdb-mall

@Bean
public WxMpService wxOpenService() {
  WxMpService wxOpenService = new WxMpServiceImpl();
  wxOpenService.setWxMpConfigStorage(wxOpenConfigStorage());
  return wxOpenService;
}

代码示例来源:origin: sqmax/springboot-project

@Bean
public WxMpService wxOpenService(){
  WxMpService wxOpenService=new WxMpServiceImpl();
  wxOpenService.setWxMpConfigStorage(wxOpenConfigStorage());
  return wxOpenService;
}
@Bean

代码示例来源:origin: sqmax/springboot-project

@Bean
public WxMpService wxMpService(){
  WxMpService wxMpService=new WxMpServiceImpl();
  wxMpService.setWxMpConfigStorage(wxMpConfigStorage());
  return wxMpService;
}
@Bean

代码示例来源:origin: linxinzhe/java-springboot-sell

@Bean
public WxMpService wxMpService() {
  WxMpService wxMpService = new WxMpServiceImpl();
  wxMpService.setWxMpConfigStorage(wxMpConfigStorage());
  return wxMpService;
}

代码示例来源:origin: linxinzhe/java-springboot-sell

@Bean
public WxMpService wxOpenService() {
  WxMpService wxOpenService = new WxMpServiceImpl();
  wxOpenService.setWxMpConfigStorage(wxOpenConfigStorage());
  return wxOpenService;
}

代码示例来源:origin: aillamsun/genesis

/**
 * 初始化微信相关配置
 */
public static void initService() {
  wxMpService = new WxMpServiceImpl();
  wxMpService.setWxMpConfigStorage(getConfig());
}

代码示例来源:origin: binarywang/weixin-java-mp-demo-springboot

@PostConstruct
public void initServices() {
  // 代码里 getConfigs()处报错的同学,请注意仔细阅读项目说明,你的IDE需要引入lombok插件!!!!
  final List<WxMpProperties.MpConfig> configs = this.properties.getConfigs();
  if (configs == null) {
    throw new RuntimeException("大哥,拜托先看下项目首页的说明(readme文件),添加下相关配置,注意别配错了!");
  }
  mpServices = configs.stream().map(a -> {
    WxMpInMemoryConfigStorage configStorage = new WxMpInMemoryConfigStorage();
    configStorage.setAppId(a.getAppId());
    configStorage.setSecret(a.getSecret());
    configStorage.setToken(a.getToken());
    configStorage.setAesKey(a.getAesKey());
    WxMpService service = new WxMpServiceImpl();
    service.setWxMpConfigStorage(configStorage);
    routers.put(a.getAppId(), this.newRouter(service));
    return service;
  }).collect(Collectors.toMap(s -> s.getWxMpConfigStorage().getAppId(), a -> a, (o, n) -> o));
}

代码示例来源:origin: yjjdick/sdb-mall

@Bean
public Object services() {
  mpServices = this.properties.getConfigs()
      .stream()
      .map(a -> {
        WxMpInMemoryConfigStorage configStorage = new WxMpInMemoryConfigStorage();
        configStorage.setAppId(a.getAppId());
        configStorage.setSecret(a.getSecret());
        configStorage.setToken(a.getToken());
        configStorage.setAesKey(a.getAesKey());
        WxMpService service = new WxMpServiceImpl();
        service.setWxMpConfigStorage(configStorage);
        routers.put(a.getAppId(), this.newRouter(service));
        return service;
      }).collect(Collectors.toMap(s -> s.getWxMpConfigStorage().getAppId(), a -> a));
  return Boolean.TRUE;
}

相关文章