package cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.electronicInvoice.restapi;

import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.electronicInvoice.dto.request.BatchQueryRequest;
import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.electronicInvoice.dto.response.BatchQueryResponse;
import com.github.lianjiatech.retrofit.spring.boot.annotation.OkHttpClientBuilder;
import com.github.lianjiatech.retrofit.spring.boot.annotation.RetrofitClient;
import okhttp3.OkHttpClient;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Headers;
import retrofit2.http.POST;

import java.util.concurrent.TimeUnit;

/**
 * @Description: 1.1.3_批量查询接口-接口说明: 企业向电子发票服务平台推送查询数据信息
 * 调用方式: https post 方式
 * 格式: json
 * 接口编码: SZHX.EINV.BATCH_QUERY
 * 地址: https://XX/dzfp/electronicInvoiceFunction
 * @Author: linjinyu
 * @CreateDate: 2021/12/23 下午5:13
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021/12/23 下午5:13
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@RetrofitClient(baseUrl = "${openapi.call.thirdpart.szhtxx.electronicInvoice.baseUrl}")
public interface BatchQueryCallApi {

    /****************************************** 配置 start ******************************************/

    @OkHttpClientBuilder
    static OkHttpClient.Builder okhttpClientBuilder() {
        return new OkHttpClient
                .Builder()
                .connectTimeout(60, TimeUnit.SECONDS)
                .readTimeout(60, TimeUnit.SECONDS)
                .writeTimeout(60, TimeUnit.SECONDS);

    }

    /****************************************** 接口 start ******************************************/

    /**
     * 接口说明: 企业向电子发票服务平台推送查询数据信息
     * 调用方式: https post 方式
     * 格式: json
     * 接口编码: SZHX.EINV.BATCH_QUERY
     * 地址: https://XX/dzfp/electronicInvoiceFunction
     *
     * @param request
     * @return
     */
    @Headers({
            "SID: SZHX.EINV.BATCH_QUERY"
    })
//	@POST("batchRes")
    @POST("electronicInvoiceFunction")
    Call<BatchQueryResponse> callBatchQueryApi(@Body BatchQueryRequest request);
}
