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

import com.heyu.api.data.utils.StringUtils;
import com.heyu.api.baidu.BaiduBaseHandle;
import com.heyu.api.baidu.request.others.BFacadeRequest;
import com.heyu.api.baidu.response.others.BFacadeResp;
import org.springframework.stereotype.Component;

/***
 * https://console.bce.baidu.com/support/?_=1740667714316&timestamp=1740669989457#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E5%85%B6%E4%BB%96%E5%9C%BA%E6%99%AFOCR&api=rest%2F2.0%2Focr%2Fv1%2Ffacade&method=post
 *
 * 门脸文字识别
 */
@Component
public class BFacadeHandle  extends BaiduBaseHandle<BFacadeRequest, BFacadeResp> {

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

    @Override
    public String check(BFacadeRequest bFacadeRequest) {
        if(StringUtils.isBlank(bFacadeRequest.getImage())){
            return " image 图像数据不能为空";
        }
        return null;
    }

    @Override
    public String getContent(BFacadeRequest bFacadeRequest) {
        return "image=" + bFacadeRequest.getImage();
    }
}
