package com.yeejoin.amos.boot.module.hygf.api.hwsms;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 发送短信验证码
 * @author xxz
 */
@Component
public class SendSmsCode {

    @Autowired
    HwSendSms hwSendSms;

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

    private static final int SUCCESS_STATUS = 200;

    public boolean sendSmsCode (String mobile, String templateParas) throws Exception {
        int i = hwSendSms.sendSms(mobile, templateParas, templateId);
        return i == SUCCESS_STATUS;
    }
}
