org.zodiac.autoconfigure.sms.PlatformSmsAutoConfiguration Maven / Gradle / Ivy
package org.zodiac.autoconfigure.sms;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.zodiac.autoconfigure.sms.condition.ConditionalOnPlatformSms;
import org.zodiac.core.web.WebOperations;
/**
* Sms配置类。
*
*/
@SpringBootConfiguration
@ConditionalOnPlatformSms
public class PlatformSmsAutoConfiguration {
public PlatformSmsAutoConfiguration() {
super();
}
@Bean
@ConditionalOnMissingBean
@ConfigurationProperties(prefix = org.zodiac.sms.constants.PlatformSmsSystemPropertiesConstants.PLATFORM_SMS_PREFIX,
ignoreInvalidFields = true)
protected PlatformSmsProperties platformSmsProperties() {
return new PlatformSmsProperties();
}
@Bean
@ConditionalOnMissingBean
@Order(value = Ordered.LOWEST_PRECEDENCE)
protected org.zodiac.sms.service.SmsService
smsService(org.zodiac.security.SecurityAuthOperations2 securityAuthOperations) {
return new org.zodiac.sms.service.impl.DefaultSmsServiceImpl,
org.zodiac.sms.model.entity.SmsEntity, org.zodiac.sms.model.SmsViewVO>(securityAuthOperations);
}
@Bean
@ConditionalOnMissingBean
@Order(value = Ordered.LOWEST_PRECEDENCE)
protected org.zodiac.sms.builder.SmsBuilder smsBuilder(PlatformSmsProperties platformSmsProperties,
org.zodiac.sms.service.SmsService smsService, org.zodiac.redis.RedisDataOperation redisDataOperation,
org.zodiac.security.SecurityAuthOperations2 securityAuthOperations,
org.zodiac.security.SecurityCacheOperations securityCacheOperations, WebOperations webOperations) {
return new org.zodiac.sms.builder.DefaultSmsBuilder(platformSmsProperties, smsService, redisDataOperation,
securityAuthOperations, securityCacheOperations, webOperations);
}
}