package cn.iocoder.yudao.module.ocr.api;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.ocr.api.dto.VehicleLicenseRespDTO;
import cn.iocoder.yudao.module.ocr.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * OCR 识别 API 接口
 *
 * @author 芋道源码
 */
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿：fallbackFactory =
@Tag(name = "RPC 服务 - OCR 识别")
public interface OcrApi {

    String PREFIX = ApiConstants.PREFIX + "/recognition";

    @PostMapping(PREFIX + "/vehicle-license")
    @Operation(summary = "识别行驶证（提供给内部模块）")
    @Parameter(name = "imageData", description = "图片数据（Base64编码）", required = true)
    @Parameter(name = "provider", description = "OCR厂商（可选，默认使用配置的默认厂商）", example = "baidu")
    CommonResult<VehicleLicenseRespDTO> recognizeVehicleLicense(
            @RequestParam("imageData") String imageData,
            @RequestParam(value = "provider", required = false) String provider);

}
