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


import com.aliyun.imageenhan20190930.models.AssessExposureRequest;
import com.aliyun.imageenhan20190930.models.AssessExposureResponse;
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.imageenhan.AAssessExposureRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * https://next.api.aliyun.com/api/imageenhan/2019-09-30/AssessExposure
 * 图像曝光度评分 AssessExposure
 */
@Component
@Slf4j
@CustomPath("assessExposure")
public class AAssessExposureHandle extends AlibabaBaseHandle<AAssessExposureRequest, AssessExposureResponse> {


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

    @Override
    public String check(AAssessExposureRequest aAssessExposureRequest) {
        return checkUrlBase64(aAssessExposureRequest);
    }


    @Override
    public AssessExposureResponse run(AAssessExposureRequest aAssessExposureRequest, RuntimeOptions runtime) throws Exception {
        AssessExposureRequest assessExposureRequest = new AssessExposureRequest();
        assessExposureRequest.setImageURL(assessExposureRequest.getImageURL());
        // 复制代码运行请自行打印 API 的返回值
        return client.assessExposureWithOptions(assessExposureRequest, runtime);
    }
}
