支付宝和微信工具类参数从sysParam取出

This commit is contained in:
张松 2025-03-10 10:58:43 +08:00
parent 68b7adb552
commit f5af188439
1 changed files with 9 additions and 9 deletions

View File

@ -24,7 +24,7 @@ import org.springframework.stereotype.Component;
public class SmsUtil {
@Resource
private ApplicationContext applicationContext;
@DubboReference(check = false)
// @DubboReference(check = false)
private SysParamsService remoteSysParamsService;
private SysParamsService sysParamsService;
@ -46,14 +46,14 @@ public class SmsUtil {
@PostConstruct
public void init() {
sysParamsService = remoteSysParamsService == null ? applicationContext.getBean(SysParamsService.class): remoteSysParamsService;
CzgResult<SysParamsDTO> aliSmsKey = sysParamsService.getParamsByCode("ali_sms_key");
CzgResult<SysParamsDTO> aliSmsSecret = sysParamsService.getParamsByCode("ali_sms_secret");
CzgResult<SysParamsDTO> aliSmsTemplateCode = sysParamsService.getParamsByCode("ali_sms_template_code");
key = aliSmsKey.getData().getParamValue();
secret = aliSmsSecret.getData().getParamValue();
templateCode = aliSmsTemplateCode.getData().getParamValue();
log.info("短信工具类初始化完毕key: {}, secret: {}, templateCode: {}", key, secret, templateCode);
// sysParamsService = remoteSysParamsService == null ? applicationContext.getBean(SysParamsService.class): remoteSysParamsService;
// CzgResult<SysParamsDTO> aliSmsKey = sysParamsService.getParamsByCode("ali_sms_key");
// CzgResult<SysParamsDTO> aliSmsSecret = sysParamsService.getParamsByCode("ali_sms_secret");
// CzgResult<SysParamsDTO> aliSmsTemplateCode = sysParamsService.getParamsByCode("ali_sms_template_code");
// key = aliSmsKey.getData().getParamValue();
// secret = aliSmsSecret.getData().getParamValue();
// templateCode = aliSmsTemplateCode.getData().getParamValue();
// log.info("短信工具类初始化完毕key: {}, secret: {}, templateCode: {}", key, secret, templateCode);
}
public Client createClient() throws Exception {