package cn.pluss.platform.controller.merchant;

import cn.pluss.platform.api.Result;
import cn.pluss.platform.api.ResultGenerator;
import cn.pluss.platform.baidu.BaiduFaceDetectService;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author DJH
 */
@RestController
@RequestMapping("/mercAuth")
public class MercAuthController {

    @Autowired
    private BaiduFaceDetectService baiduFaceDetectService;

    @PostMapping("/mercFaceDetect")
    public Result<?> mercFaceDetect(@RequestBody JSONObject params) {
        baiduFaceDetectService.apiCheckFaceMatch(params.getString("dist"));

        return ResultGenerator.genSuccessResult("验证通过", null);
    }
}
