package com.heyu.api.baidu.handle.convert;

import com.heyu.api.baidu.BaiduBaseHandle;
import com.heyu.api.baidu.request.convert.BDocConvertRequest;
import com.heyu.api.baidu.response.convert.BDocConvertResp;
import org.springframework.stereotype.Component;

/***
 * https://console.bce.baidu.com/support/?_=1740667714316&timestamp=1740671969203#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E6%99%BA%E8%83%BD%E6%96%87%E6%A1%A3%E5%88%86%E6%9E%90&api=rest%2F2.0%2Focr%2Fv1%2Fdoc_convert%2Frequest&method=post
 *
 * 文档格式转换-提交请求
 */
@Component
public class BDocConvertHandle extends BaiduBaseHandle<BDocConvertRequest, BDocConvertResp> {
    @Override
    public String getUri() {
        return "/rest/2.0/ocr/v1/doc_convert/request";
    }

    @Override
    public String check(BDocConvertRequest bDocConvertRequest) {

        return checkPdf(bDocConvertRequest);
    }

    @Override
    public String getContent(BDocConvertRequest bDocConvertRequest) {
        return getPdfContent(bDocConvertRequest).toString();
    }
}
