package com.yh.saas.platform.config;


import com.yh.saas.plugin.yiliangyiyun.util.AliyunSMSClient;
import com.yh.saas.plugin.yiliangyiyun.util.MockSMSClient;
import com.yh.saas.plugin.yiliangyiyun.util.SMSClientYlyy;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by rize on 2019/7/2.
 */
@Configuration
public class SMSConfigYlyy {

    @Value("${sms.enable}")
    private String enable;

    @Bean
    public SMSClientYlyy smsClientYlyy() {
        if ("aliyun".equals(enable)) {
            return new AliyunSMSClient();
        } else if ("mock".equals(enable)) {
            return new MockSMSClient();
        } else {
            return new MockSMSClient();
        }
    }
}
