package com.ydtech.modules.order.components; import com.ydtech.modules.order.entity.crawler.request.RecognitionRequest; import com.ydtech.modules.order.entity.crawler.response.RecognitionResponse; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpHeaders; import org.springframework.stereotype.Component; /** * @description: 验证码识别 * @author: wenks * @date: 2023/9/19 18:17 **/ @Component public class VerificationCodeIdentification { @Value("${image.identificationUrl}") private String identificationUrl; private final InsCrawlerOrderComponents insCrawlerOrderComponents; public VerificationCodeIdentification(InsCrawlerOrderComponents insCrawlerOrderComponents) { this.insCrawlerOrderComponents = insCrawlerOrderComponents; } public RecognitionResponse recognition(RecognitionRequest request) { final String identificationLogId = "verification-code"; return insCrawlerOrderComponents.post(identificationUrl, identificationLogId, "验证码识别", request, RecognitionResponse.class, new HttpHeaders()); } }