package org.dromara.business.utils;

import cn.hutool.core.util.StrUtil;
import org.dromara.sms4j.api.SmsBlend;
import org.dromara.sms4j.api.entity.SmsResponse;
import org.dromara.sms4j.core.factory.SmsFactory;
import org.dromara.sms4j.provider.enumerate.SupplierType;

import java.util.LinkedHashMap;

/**
 * sms短信工具类
 *
 * @author wuzhigang
 */
public class SmsUtils {

    /**
     * 发送短信-阿里云
     *
     * @param phone 手机号
     * @param templateId 短信模版ID
     * @param map 短信参数
     * @return
     */
    public static SmsResponse sendAlibabaMessage(String phone,String templateId, LinkedHashMap<String, String> map) {
        SmsBlend smsBlend = SmsFactory.createSmsBlend(SupplierType.ALIBABA);
        SmsResponse smsResponse = smsBlend.sendMessage(phone, templateId, map);
        return smsResponse;
    }
}
