cn.binarywang.wx.miniapp.config.WxMaInMemoryConfig Java Examples

The following examples show how to use cn.binarywang.wx.miniapp.config.WxMaInMemoryConfig. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WxMaUser.java    From yue-library with Apache License 2.0 6 votes vote down vote up
@PostConstruct
private void init() {
    List<WxMaProperties.Config> configs = wxMaProperties.getConfigs();
    if (ListUtils.isEmpty(configs)) {
    	throw new RuntimeException("无效的小程序配置...");
    }
    
    maServices = configs.stream()
        .map(a -> {
            WxMaInMemoryConfig config = new WxMaInMemoryConfig();
            config.setAppid(a.getAppid());
            config.setSecret(a.getSecret());
            WxMaService service = new WxMaServiceImpl();
            service.setWxMaConfig(config);
            return service;
        }).collect(Collectors.toMap(s -> s.getWxMaConfig().getAppid(), a -> a));
}
 
Example #2
Source File: WxConfig.java    From BigDataPlatform with GNU General Public License v3.0 5 votes vote down vote up
@Bean
public WxMaConfig wxMaConfig() {
    WxMaInMemoryConfig config = new WxMaInMemoryConfig();
    config.setAppid(properties.getAppId());
    config.setSecret(properties.getAppSecret());
    return config;
}
 
Example #3
Source File: WxConfig.java    From dts-shop with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Bean
public WxMaConfig wxMaConfig() {
	WxMaInMemoryConfig config = new WxMaInMemoryConfig();
	config.setAppid(properties.getAppId());
	config.setSecret(properties.getAppSecret());
	return config;
}
 
Example #4
Source File: WxConfig.java    From spring-microservice-exam with MIT License 5 votes vote down vote up
@Bean
public WxMaConfig wxMaConfig() {
    WxMaInMemoryConfig config = new WxMaInMemoryConfig();
    config.setAppid(wxProperties.getAppId());
    config.setSecret(wxProperties.getAppSecret());
    return config;
}
 
Example #5
Source File: WxMaConfiguration.java    From charging_pile_cloud with MIT License 5 votes vote down vote up
@Bean
public Object services(){
    WxMaInMemoryConfig config = new WxMaInMemoryConfig();
    config.setAppid(wxPayProperties.getWxAppId());
    config.setSecret(wxPayProperties.getWxAppSecret());
    //config.setToken(token);
    //config.setAesKey(aesKey);

    wxMaService = new WxMaServiceImpl();
    wxMaService.setWxMaConfig(config);

    return Boolean.TRUE;
}
 
Example #6
Source File: WxConfig.java    From mall with MIT License 5 votes vote down vote up
@Bean
public WxMaConfig wxMaConfig() {
    WxMaInMemoryConfig config = new WxMaInMemoryConfig();
    config.setAppid(properties.getAppId());
    config.setSecret(properties.getAppSecret());
    return config;
}
 
Example #7
Source File: WechatMiniAppAutoConfiguration.java    From fast-family-master with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public WxMaConfig maConfig() {
    WxMaInMemoryConfig config = new WxMaInMemoryConfig();
    config.setAppid(this.properties.getAppId());
    config.setSecret(this.properties.getSecret());
    Optional.ofNullable(this.properties.getToken()).ifPresent(config::setToken);
    Optional.ofNullable(this.properties.getAesKey()).ifPresent(config::setAesKey);
    config.setMsgDataFormat(Optional.ofNullable(this.properties.getMsgDataFormat()).orElse("JSON"));
    return config;
}
 
Example #8
Source File: WxConfig.java    From litemall with MIT License 5 votes vote down vote up
@Bean
public WxMaConfig wxMaConfig() {
    WxMaInMemoryConfig config = new WxMaInMemoryConfig();
    config.setAppid(properties.getAppId());
    config.setSecret(properties.getAppSecret());
    return config;
}
 
Example #9
Source File: WxMiniAppConfiguration.java    From xiaoyuanxianyu with Apache License 2.0 5 votes vote down vote up
@Bean
public WxMaInMemoryConfig WxConfig() {
    WxMaInMemoryConfig config = new WxMaInMemoryConfig();
    config.setAppid(this.appid);
    config.setSecret(this.secret);
    config.setToken(this.token);
    config.setAesKey(this.aesKey);
    config.setMsgDataFormat(this.msgDataFormat);
    return config;
}
 
Example #10
Source File: WxMaConfiguration.java    From sdb-mall with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public WxMaConfig maConfig() {
    WxMaInMemoryConfig config = new WxMaInMemoryConfig();
    config.setAppid(this.properties.getAppid());
    config.setSecret(this.properties.getSecret());
    config.setToken(this.properties.getToken());
    config.setAesKey(this.properties.getAesKey());
    config.setMsgDataFormat(this.properties.getMsgDataFormat());

    return config;
}
 
Example #11
Source File: MiniAppConfiguration.java    From springboot-seed with MIT License 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public WxMaConfig maConfig() {
    WxMaInMemoryConfig config = new WxMaInMemoryConfig();
    config.setAppid(this.properties.getId());
    config.setSecret(this.properties.getSecret());
    config.setToken(this.properties.getToken());
    config.setAesKey(this.properties.getAesKey());
    config.setMsgDataFormat(this.properties.getMessageFormat());

    return config;
}
 
Example #12
Source File: WechatMiniAppConfiguration.java    From loc-framework with MIT License 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public WxMaConfig maConfig() {
  WxMaInMemoryConfig config = new WxMaInMemoryConfig();
  config.setAppid(this.properties.getAppId());
  config.setSecret(this.properties.getSecret());
  Optional.ofNullable(this.properties.getToken()).ifPresent(config::setToken);
  Optional.ofNullable(this.properties.getAesKey()).ifPresent(config::setAesKey);
  config.setMsgDataFormat(Optional.ofNullable(this.properties.getMsgDataFormat()).orElse("JSON"));
  return config;
}