All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.fangxinqian.operator.sdk.sms.SmsService Maven / Gradle / Ivy

There is a newer version: 1.1.2
Show newest version
package cn.fangxinqian.operator.sdk.sms;

import cn.fangxinqian.operator.sdk.constant.UrlConstant;
import cn.fangxinqian.operator.sdk.sms.dto.SmsDTO;
import cn.fangxinqian.operator.sdk.sms.vo.SmsResultVO;
import cn.fangxinqian.operator.sdk.utils.OkHttp;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import java.io.IOException;

/**
 * @Author NieZhiLiang
 * @Email [email protected]
 * @GitHub https://github.com/niezhiliang
 * @Date 2019-10-09 3:47 下午
 */
public class SmsService {

    /**
     * 短信发送
     * @param smsDTO
     * @return
     * @throws IOException
     */
    public static SmsResultVO sendMsg(SmsDTO smsDTO) throws IOException {

         String result = OkHttp.doPost(UrlConstant.CHUANGLAN_SMS, JSON.toJSONString(smsDTO));
         return JSONObject.parseObject(result,SmsResultVO.class);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy