package com.qmth.boot.core.sms.api;

import com.qmth.boot.core.retrofit.annotatioin.RetrofitClient;
import com.qmth.boot.core.retrofit.utils.SignatureInfo;
import com.qmth.boot.core.sms.config.SmsApiConfiguration;
import com.qmth.boot.core.sms.model.SmsConstants;
import com.qmth.boot.core.sms.model.SmsSendRequest;
import com.qmth.boot.core.sms.model.SmsSendResponse;
import retrofit2.http.Body;
import retrofit2.http.POST;
import retrofit2.http.Tag;
import retrofit2.http.Url;

@RetrofitClient(configuration = SmsApiConfiguration.class)
public interface SmsApiClient {

    /**
     * 发送普通短信
     *
     * @return
     */
    @POST(SmsConstants.API_PATH_SEND_SMS)
    SmsSendResponse sendSms(@Body SmsSendRequest request);

    /**
     * 使用机构鉴权发送普通短信
     *
     * @param signature 使用机构AK构造Secret类型签名
     * @param request   请求体
     * @return
     */
    @POST(SmsConstants.API_PATH_SEND_SMS)
    SmsSendResponse sendSms(@Tag SignatureInfo signature, @Body SmsSendRequest request);

    /**
     * 往指定接口地址发送普通短信
     * url必须是完整路径，带http或https前缀
     *
     * @return
     */
    @POST
    SmsSendResponse sendSms(@Url String url, @Body SmsSendRequest request);
}
