package com.dcsoft.file.service;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.dcsoft.common.core.constant.CacheConstants;
import com.dcsoft.common.core.utils.StringUtils;
import com.dcsoft.file.utils.HttpUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.util.*;

/**
 * 用户管理 服务层处理
 *
 * @author xueyi
 */
@Service
public class AlgoServiceImpl implements IAlgoService {


    @Value("${uni.faceUrl}")
    public String uniUrl;


    //检测图片
    public String judgeImage(String admitGuids){
        String url=uniUrl+"/algo/wrapper/judgeImage";
        Map<String, Object> paramMap=new HashMap<String, Object>();
        paramMap.put("imageDataBase64",admitGuids);
        String response= HttpUtil.postData(url,null,paramMap);
        return response;
    }

   /* //提取特征值
    public String getFeature(String admitGuids){
        String url=uniUrl+"/algo/wrapper/getFeature";
        Map<String, Object> headMap=new HashMap<String, Object>();
        Map<String, Object> paramMap=new HashMap<String, Object>();
        paramMap.put("admitGuids",admitGuids);
        String response= HttpUtil.postData(url,headMap,paramMap);
        return response;
    }

    //图片压缩
    public String getSimpleImage(String admitGuids){
        String url=uniUrl+"/algo/wrapper/getSimpleImage";
        Map<String, Object> headMap=new HashMap<String, Object>();
        Map<String, Object> paramMap=new HashMap<String, Object>();
        paramMap.put("admitGuids",admitGuids);
        String response= HttpUtil.postData(url,headMap,paramMap);
        return response;
    }
*/
}
