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

import com.heyu.api.data.annotation.CustomPath;
import com.heyu.api.baidu.BaiduBaseHandle;
import com.heyu.api.baidu.request.financial.BTrainTicketRequest;
import com.heyu.api.baidu.response.financial.BTrainTicketResp;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * https://console.bce.baidu.com/support/#/api?product=AI&project=文字识别&parent=财务票据OCR&api=rest%2F2.0%2Focr%2Fv1%2Ftrain_ticket&method=post
 *
 * 火车票识别
 */
@Component
@Slf4j
@CustomPath("trainTicket")
public class BTrainTicketHandle extends BaiduBaseHandle<BTrainTicketRequest, BTrainTicketResp> {

    @Override
    public String getUri() {
        return "/rest/2.0/ocr/v1/train_ticket";
    }

    @Override
    public String check(BTrainTicketRequest request) {
        return checkImageUri(request);
    }

    @Override
    public String getContent(BTrainTicketRequest request) {
        return getImageContent(request).toString();
    }
}
