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


import com.aliyun.imageenhan20190930.models.AssessCompositionRequest;
import com.aliyun.imageenhan20190930.models.AssessCompositionResponse;
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.AAssessCompositionRequest;
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/AssessComposition?tab=DEMO&lang=JAVA
 * <p>
 * <p>
 * 图像构图美学评分 AssessComposition
 */

@Component
@Slf4j
@CustomPath("assessComposition")
public class AAssessCompositionHandle extends AlibabaBaseHandle<AAssessCompositionRequest, AssessCompositionResponse> {

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


    @Override
    public String check(AAssessCompositionRequest aAssessCompositionRequest) {
        return checkUrlBase64(aAssessCompositionRequest);
    }




    @Override
    public AssessCompositionResponse run(AAssessCompositionRequest aAssessCompositionRequest, RuntimeOptions runtime) throws Exception {
        AssessCompositionRequest request = new AssessCompositionRequest();
        request.setImageURL(aAssessCompositionRequest.getImageUrl());
        // 复制代码运行请自行打印 API 的返回值
        return client.assessCompositionWithOptions(request, runtime);
    }
}
