普惠GO服务端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
puhui-go/cweb/src/main/java/com/cweb/config/WxMaConfiguration.java

33 lines
965 B

package com.cweb.config;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl;
import org.springframework.context.annotation.Configuration;
import javax.annotation.PostConstruct;
@Configuration
public class WxMaConfiguration {
private static WxMaService maService;
public static WxMaService getMaService() {
if (maService == null) {
throw new IllegalArgumentException(String.format("未找到对应的配置,请核实!"));
}
return maService;
}
@PostConstruct
public void init() {
/*WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl();
config.setAppid(SysConst.getSysConfig().getWxAppId());
config.setSecret(SysConst.getSysConfig().getWxAppSecret());
maService = new WxMaServiceImpl();
maService.setWxMaConfig(config);*/
}
}