<?php
/**
 * Created by PhpStorm.
 * User: Airon
 * Date: 2017/7/11
 * Time: 14:56
 */

namespace app\api\logic\app;

use app\api\model\Sms as SmsModel;

class SendLogic
{
    public static function SendSms($mobile, $sms_type)
    {
        return SmsModel::sendSms($mobile, randString(6), $sms_type);
    }

    /**
     * @author: Airon
     * @time:   2018年5月
     * description
     * @param $requestData
     * @return bool
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public static function validateCode($requestData)
    {
        return SmsModel::validateCode(
            $requestData['mobile'],
            $requestData['code'],
            $requestData['sms_type']
        );
    }
}