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


import com.aliyun.imageenhan20190930.models.RemoveImageWatermarkRequest;
import com.aliyun.imageenhan20190930.models.RemoveImageWatermarkResponse;
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.ARemoveImageWatermarkRequest;
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/RemoveImageWatermark?tab=DEMO&lang=JAVA
 * <p>
 * <p>
 * 台标标志擦除
 *
 * RemovelmageWatermark
 */
@Component
@Slf4j
@CustomPath("removeImageWatermark")
public class ARemoveImageWatermarkHandle extends AlibabaBaseHandle<ARemoveImageWatermarkRequest, RemoveImageWatermarkResponse> {

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

    @Override
    public String check(ARemoveImageWatermarkRequest aRemoveImageWatermarkRequest) {
        return checkUrlBase64(aRemoveImageWatermarkRequest);
    }


    @Override
    public RemoveImageWatermarkResponse run(ARemoveImageWatermarkRequest aRemoveImageWatermarkRequest, RuntimeOptions runtime) throws Exception {
        RemoveImageWatermarkRequest removeImageWatermarkRequest = new RemoveImageWatermarkRequest();
        removeImageWatermarkRequest.setImageURL(aRemoveImageWatermarkRequest.getImageUrl());
        // 复制代码运行请自行打印 API 的返回值
        return client.removeImageWatermarkWithOptions(removeImageWatermarkRequest, runtime);
    }
}
