package com.mzl.flower.config.sms; import com.mzl.flower.service.sms.TosSmsService; import com.volcengine.service.sms.SmsService; import com.volcengine.service.sms.SmsServiceInfoConfig; import com.volcengine.service.sms.impl.SmsServiceImpl; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import javax.annotation.Resource; @Configuration public class TosSmsServiceConfig { @Resource private TosSmsProperties tosSmsProperties; @Bean(name = "volcSmsService") public SmsService smsService() { return SmsServiceImpl.getInstance(new SmsServiceInfoConfig(tosSmsProperties.getKeyid(), tosSmsProperties.getKeysecret())); } }