package com.feng1.foundation.service.impl;
import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject;
import com.feng1.foundation.dto.BankCardInfoDTO;
import com.feng1.foundation.dto.IdentityCardInfoDTO;
import com.feng1.foundation.po.*;
import com.feng1.foundation.service.IDictionaryService;
import com.feng1.foundation.service.IImageRecognitionService;
import com.feng1.foundation.service.vo.DictionaryItemVO;
import com.feng1.framework.common.domain.result.ModelResult;
import com.feng1.framework.common.domain.result.ModelResultClient;
import com.feng1.framework.common.http.HttpClient;
import com.feng1.framework.util.DateUtil;
import com.feng1.framework.util.JsonUtils;
import com.google.common.collect.Lists;
import okhttp3.MediaType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RestController;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;
import static org.apache.commons.codec.binary.Base64.encodeBase64;
@RestController
public class ImageRecognitionServiceImpl implements IImageRecognitionService {
private static final Logger LOGGER = LoggerFactory.getLogger(ImageRecognitionServiceImpl.class);
@Autowired
HttpClient httpClient;
@Autowired
IDictionaryService dictionaryService;
@Value("${imageRecognition.idCardHost}")
private String idCardHost;
@Value("${imageRecognition.idCardServicePath}")
private String idCardServicePath;
@Value("${imageRecognition.appcode}")
private String appcode;
@Value("${imageRecognition.qiniuPath}")
private String qiniuPath;
@Value("${imageRecognition.bankCardHost}")
private String ba