package org.jeecg.modules.app.ezt;

import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.faceid.v20180301.FaceidClient;
import com.tencentcloudapi.faceid.v20180301.models.GetEidResultRequest;
import com.tencentcloudapi.faceid.v20180301.models.GetEidResultResponse;

public class GetEidResult {
    private static final String SECRET_ID = "AKIDjKjvugEajfOuCGBtQjpkSxEIBqIWZO0g "; // TODO 您账号的腾讯云密钥
    private static final String SECRET_KEY = "Xt30nNkuvlOo0zlbMwIh1AasxfBUZS7Z"; // TODO 您账号的腾讯云密钥
    private static final String REGION = "ap-guangzhou";
    public static void main(String[] args) {
        // Step 1. 初始化客户端实例
        Credential credential = new Credential(SECRET_ID, SECRET_KEY);
        FaceidClient faceidClient = new FaceidClient(credential, REGION);
        // Step 2. 使用Tencent Cloud API SDK组装请求体，填充参数
        // 详细的接口文档请参考：https://cloud.tencent.com/document/product/1007/54090
        GetEidResultRequest request = new GetEidResultRequest();
        request.setEidToken(""); // 通过GetEidResult接口获取到的EidToken
        request.setInfoType("0"); // 指定拉取的结果信息
        try {
            // Step 3. 调用接口
            GetEidResultResponse response = faceidClient.GetEidResult(request);
            System.out.println("SDK response: " + GetEidResultResponse.toJsonString(response));
        } catch (TencentCloudSDKException e) {
            // 调用接口异常在这里处理
            System.err.println("invoke error, code: " + e.getErrorCode() + "message: " + e.getMessage());
            e.printStackTrace();
        }
    }
}
