package com.heyu.api.alibaba.handle.facebody;


import com.aliyun.facebody20191230.models.ExtractFingerPrintRequest;
import com.aliyun.facebody20191230.models.ExtractFingerPrintResponse;
import com.aliyun.teautil.models.RuntimeOptions;
import com.heyu.api.data.annotation.CustomPath;
import com.heyu.api.alibaba.AlibabaBaseHandle;
import com.heyu.api.alibaba.request.facebody.AExtractFingerPrintRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * https://next.api.aliyun.com/api/facebody/2019-12-30/ExtractFingerPrint?tab=DEMO&lang=JAVA
 * <p>
 * 指纹提取
 * <p>
 * ExtractFingerPrint
 */
@Component
@Slf4j
@CustomPath("extractFingerPrint")
public class AExtractFingerPrintHandle extends AlibabaBaseHandle<AExtractFingerPrintRequest, ExtractFingerPrintResponse> {

    @Autowired
    private com.aliyun.facebody20191230.Client client;


    @Override
    public String check(AExtractFingerPrintRequest aExtractFingerPrintRequest) {
        return checkUrlBase64(aExtractFingerPrintRequest);
    }



    @Override
    public ExtractFingerPrintResponse run(AExtractFingerPrintRequest aExtractFingerPrintRequest, RuntimeOptions runtime) throws Exception {

        ExtractFingerPrintRequest request = new ExtractFingerPrintRequest();
        request.setImageURL(aExtractFingerPrintRequest.getImageUrl());
        request.setImageData(aExtractFingerPrintRequest.getImageBase64());


        // 复制代码运行请自行打印 API 的返回值
        return client.extractFingerPrintWithOptions(request, runtime);
    }
}
