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


import com.heyu.api.data.annotation.CustomPath;
import com.heyu.api.baidu.BaiduBaseHandle;
import com.heyu.api.baidu.request.common.BPaddleOcrQueryRequest;
import com.heyu.api.baidu.response.common.BPaddleOcrQueryResp;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * PaddleOCR-VL 文档解析查询 Handle
 *
 * 根据 taskId 查询文档解析结果
 */
@Component
@Slf4j
@CustomPath("paddleOcrQuery")
public class BPaddleOcrQueryHandle extends BaiduBaseHandle<BPaddleOcrQueryRequest, BPaddleOcrQueryResp> {

    @Override
    public String getUri() {
        return "/rest/2.0/brain/online/v2/paddle-vl-parser/task/query";
    }

    @Override
    public String check(BPaddleOcrQueryRequest bPaddleOcrQueryRequest) {
        return checkTaskId(bPaddleOcrQueryRequest);
    }

    @Override
    public String getContent(BPaddleOcrQueryRequest bPaddleOcrQueryRequest) {
        return "task_id=" + bPaddleOcrQueryRequest.getTaskId();
    }
}
