package com.bonus.gs.sub.evaluate.manager.utils;


import cn.hutool.http.HttpRequest;

/**
 * @author fly
 * 客通云 短信
 */
public class KtySmsUtil {

    /**
     * url地址
     */
    public String smsUrl = "http://api.ktsms.cn/sms_token?";

    /**
     * 用户名  -- 这个是考试的
     */
    public String key = "bonusgs";
    /**
     * 密码  -- 这个是考试的
     */
    public String secret = "oPx14HKc";

    //短信
    public String setPhoneMsg(String key, String secret, String phone, String msg) {
        String url = smsUrl+"ddtkey="+key+"&secretkey="+secret;
        String uri = url + "&mobile=" + phone + "&content=" + msg;
        String body = HttpRequest.post(uri).execute(false).body();
        return body;
    }

    //短信
    public String setPhoneMsg(String phone, String msg) {
        String url = smsUrl+"ddtkey="+key+"&secretkey="+secret;
//        String url = "http://api.ktsms.cn/sms_token?ddtkey=bonus&secretkey=KtyBns@Admin2023!";
        String uri = url + "&mobile=" + phone + "&content=" + msg;
        String body = HttpRequest.post(uri).execute(false).body();
        System.out.println(body);
        return body;
    }
}
