支付宝和微信工具类参数从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 { public class SmsUtil {
@Resource @Resource
private ApplicationContext applicationContext; private ApplicationContext applicationContext;
@DubboReference(check = false) // @DubboReference(check = false)
private SysParamsService remoteSysParamsService; private SysParamsService remoteSysParamsService;
private SysParamsService sysParamsService; private SysParamsService sysParamsService;
@ -46,14 +46,14 @@ public class SmsUtil {
@PostConstruct @PostConstruct
public void init() { public void init() {
sysParamsService = remoteSysParamsService == null ? applicationContext.getBean(SysParamsService.class): remoteSysParamsService; // sysParamsService = remoteSysParamsService == null ? applicationContext.getBean(SysParamsService.class): remoteSysParamsService;
CzgResult<SysParamsDTO> aliSmsKey = sysParamsService.getParamsByCode("ali_sms_key"); // CzgResult<SysParamsDTO> aliSmsKey = sysParamsService.getParamsByCode("ali_sms_key");
CzgResult<SysParamsDTO> aliSmsSecret = sysParamsService.getParamsByCode("ali_sms_secret"); // CzgResult<SysParamsDTO> aliSmsSecret = sysParamsService.getParamsByCode("ali_sms_secret");
CzgResult<SysParamsDTO> aliSmsTemplateCode = sysParamsService.getParamsByCode("ali_sms_template_code"); // CzgResult<SysParamsDTO> aliSmsTemplateCode = sysParamsService.getParamsByCode("ali_sms_template_code");
key = aliSmsKey.getData().getParamValue(); // key = aliSmsKey.getData().getParamValue();
secret = aliSmsSecret.getData().getParamValue(); // secret = aliSmsSecret.getData().getParamValue();
templateCode = aliSmsTemplateCode.getData().getParamValue(); // templateCode = aliSmsTemplateCode.getData().getParamValue();
log.info("短信工具类初始化完毕key: {}, secret: {}, templateCode: {}", key, secret, templateCode); // log.info("短信工具类初始化完毕key: {}, secret: {}, templateCode: {}", key, secret, templateCode);
} }
public Client createClient() throws Exception { public Client createClient() throws Exception {