🎨 sms 和 kafka 配置前缀简化掉 starter
This commit is contained in:
@@ -21,14 +21,14 @@ public class SmsAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(SmsSender.class)
|
||||
@ConditionalOnProperty(name = "ballcat.starter.sms.type", havingValue = "TENCENT")
|
||||
@ConditionalOnProperty(name = "ballcat.sms.type", havingValue = "TENCENT")
|
||||
public SmsSender<SmsSenderParams, SmsSenderResult> tencentSmsSender(ObjectMapper om) {
|
||||
return new TencentSenderImpl(properties, om);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(SmsSender.class)
|
||||
@ConditionalOnProperty(name = "ballcat.starter.sms.type", havingValue = "TIAN_YI_HONG")
|
||||
@ConditionalOnProperty(name = "ballcat.sms.type", havingValue = "TIAN_YI_HONG")
|
||||
public SmsSender<SmsSenderParams, SmsSenderResult> tianYiHongSmsSender() {
|
||||
return new TianYiHongSenderImpl(properties);
|
||||
}
|
||||
|
||||
@@ -16,14 +16,15 @@ import com.tencentcloudapi.common.profile.HttpProfile;
|
||||
import com.tencentcloudapi.sms.v20190711.SmsClient;
|
||||
import com.tencentcloudapi.sms.v20190711.models.SendSmsRequest;
|
||||
import com.tencentcloudapi.sms.v20190711.models.SendSmsResponse;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
|
||||
/**
|
||||
* @author lingting 2020/4/26 10:03
|
||||
*/
|
||||
@ConditionalOnProperty(name = "ballcat.starter.sms.type", havingValue = "TENCENT")
|
||||
@ConditionalOnProperty(name = "ballcat.sms.type", havingValue = "TENCENT")
|
||||
public class TencentSenderImpl extends BaseServiceImpl implements SmsSender<SmsSenderParams, SmsSenderResult> {
|
||||
|
||||
private final SmsProperties properties;
|
||||
|
||||
@@ -12,13 +12,14 @@ import com.hccake.starter.sms.enums.TypeEnum;
|
||||
import com.hccake.starter.sms.properties.SmsProperties;
|
||||
import com.hccake.starter.sms.properties.extra.Account;
|
||||
import com.hccake.starter.sms.properties.extra.TianYiHong;
|
||||
import java.time.LocalDateTime;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author lingting 2020/4/26 10:03
|
||||
*/
|
||||
@ConditionalOnProperty(name = "ballcat.starter.sms.type", havingValue = "TIAN_YI_HONG")
|
||||
@ConditionalOnProperty(name = "ballcat.sms.type", havingValue = "TIAN_YI_HONG")
|
||||
public class TianYiHongSenderImpl extends BaseServiceImpl implements SmsSender<SmsSenderParams, SmsSenderResult> {
|
||||
|
||||
private final SmsProperties sp;
|
||||
|
||||
@@ -4,16 +4,17 @@ import com.hccake.starter.sms.enums.TypeEnum;
|
||||
import com.hccake.starter.sms.properties.extra.Account;
|
||||
import com.hccake.starter.sms.properties.extra.Tencent;
|
||||
import com.hccake.starter.sms.properties.extra.TianYiHong;
|
||||
import java.util.Map;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.NestedConfigurationProperty;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author lingting 2020/4/26 9:43
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties(prefix = "ballcat.starter.sms")
|
||||
@ConfigurationProperties(prefix = "ballcat.sms")
|
||||
public class SmsProperties {
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user