|
@@ -10,7 +10,6 @@ import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import javax.annotation.PostConstruct;
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -28,7 +27,6 @@ public class OcrClientService {
|
|
|
@Resource
|
|
|
private OcrSupplierService ocrSupplierService;
|
|
|
|
|
|
- @PostConstruct
|
|
|
public synchronized void init() {
|
|
|
defaultClient = null;
|
|
|
clientMap = new HashMap<>();
|
|
@@ -49,6 +47,7 @@ public class OcrClientService {
|
|
|
if (clientInstance instanceof OcrApiClient) {
|
|
|
OcrApiClient client = (OcrApiClient) clientInstance;
|
|
|
clientMap.put(supplier.getId(), client);
|
|
|
+
|
|
|
// 取第一个enable=true的为默认客户端
|
|
|
if (supplier.getEnable() && defaultClient == null) {
|
|
|
defaultClient = client;
|