Browse Source

优化oss、sms默认配置加载逻辑

test
smallchill 5 years ago
parent
commit
098ea3f737
  1. 3
      blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/OssBuilder.java
  2. 3
      blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/sms/SmsBuilder.java

3
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/OssBuilder.java

@ -138,7 +138,8 @@ public class OssBuilder {
// 若为空则调用默认配置 // 若为空则调用默认配置
if ((Func.isEmpty(o))) { if ((Func.isEmpty(o))) {
Oss defaultOss = new Oss(); Oss defaultOss = new Oss();
defaultOss.setCategory(OssEnum.QINIU.getCategory()); defaultOss.setId(0L);
defaultOss.setCategory(OssEnum.of(ossProperties.getName()).getCategory());
defaultOss.setEndpoint(ossProperties.getEndpoint()); defaultOss.setEndpoint(ossProperties.getEndpoint());
defaultOss.setBucketName(ossProperties.getBucketName()); defaultOss.setBucketName(ossProperties.getBucketName());
defaultOss.setAccessKey(ossProperties.getAccessKey()); defaultOss.setAccessKey(ossProperties.getAccessKey());

3
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/sms/SmsBuilder.java

@ -135,7 +135,8 @@ public class SmsBuilder {
// 若为空则调用默认配置 // 若为空则调用默认配置
if ((Func.isEmpty(s))) { if ((Func.isEmpty(s))) {
Sms defaultSms = new Sms(); Sms defaultSms = new Sms();
defaultSms.setCategory(SmsEnum.QINIU.getCategory()); defaultSms.setId(0L);
defaultSms.setCategory(SmsEnum.of(smsProperties.getName()).getCategory());
defaultSms.setAccessKey(smsProperties.getAccessKey()); defaultSms.setAccessKey(smsProperties.getAccessKey());
defaultSms.setSecretKey(smsProperties.getSecretKey()); defaultSms.setSecretKey(smsProperties.getSecretKey());
defaultSms.setSignName(smsProperties.getSignName()); defaultSms.setSignName(smsProperties.getSignName());

Loading…
Cancel
Save