|
|
|
@ -12,21 +12,21 @@ import org.springframework.context.annotation.Scope;
|
|
|
|
|
@Configuration |
|
|
|
|
@Slf4j |
|
|
|
|
public class WxCpConfigure { |
|
|
|
|
|
|
|
|
|
@Value("${wxcp.corpId}") |
|
|
|
|
private String corpId; |
|
|
|
|
@Value("${wxcp.farmAppid}") |
|
|
|
|
private String farmAppid; |
|
|
|
|
@Value("${wxcp.farmSecret}") |
|
|
|
|
private String farmSecret; |
|
|
|
|
@Value("${wxcp.secret}") |
|
|
|
|
private String secret; |
|
|
|
|
@Value("${wxcp.agentId}") |
|
|
|
|
private Integer agentId; |
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
|
@Scope("prototype") |
|
|
|
|
public WxCpService wxCpService(){ |
|
|
|
|
|
|
|
|
|
WxCpDefaultConfigImpl config = new WxCpDefaultConfigImpl(); |
|
|
|
|
config.setCorpId("wwb9f9734e8e124761"); |
|
|
|
|
config.setCorpSecret("B2bdszjVvby6jfbZf-TQOGeslpOEzLFUYWHldYxtkWA"); |
|
|
|
|
config.setCorpId(corpId); |
|
|
|
|
config.setCorpSecret(secret); |
|
|
|
|
config.setAgentId(agentId); |
|
|
|
|
|
|
|
|
|
WxCpServiceImpl wxCpService = new WxCpServiceImpl(); |
|
|
|
|
wxCpService.setWxCpConfigStorage(config); |
|
|
|
|