he2802 4 년 전
부모
커밋
8ed1a5e8cd

+ 7 - 1
zhongzheng-api/src/main/java/com/zhongzheng/controller/face/FaceController.java

@@ -38,7 +38,7 @@ public class FaceController extends BaseController {
     @ApiOperation("获取识别凭证")
     @GetMapping("/certification/BizToken")
     public AjaxResult<FaceVo> getBizToken() throws Exception {
-        FaceVo face = iFaceService.getFaceDetectAuth();
+        FaceVo face = iFaceService.getFaceDetectAuth("0");
         return AjaxResult.success(face);
     }
 
@@ -50,4 +50,10 @@ public class FaceController extends BaseController {
         return AjaxResult.success();
     }
 
+    @ApiOperation("获取人照识别凭证")
+    @GetMapping("/certification/PicBizToken")
+    public AjaxResult<FaceVo> getPicBizToken() throws Exception {
+        FaceVo face = iFaceService.getFaceDetectAuth("1");
+        return AjaxResult.success(face);
+    }
 }

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/face/service/IFaceService.java

@@ -5,7 +5,7 @@ import com.zhongzheng.modules.face.bo.FaceVo;
 
 public interface IFaceService {
 
-    FaceVo getFaceDetectAuth();
+    FaceVo getFaceDetectAuth(String RuleId);
 
     void getDetectInfo(String bizToken,Long userId);
 

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/face/service/impl/FaceServiceImpl.java

@@ -49,7 +49,7 @@ public class FaceServiceImpl implements IFaceService {
     private UserMapper userMapper;
 
     @Override
-    public FaceVo getFaceDetectAuth() {
+    public FaceVo getFaceDetectAuth(String RuleId) {
         try{
             Credential cred = new Credential(SecretId, SecretKey);
 
@@ -58,7 +58,7 @@ public class FaceServiceImpl implements IFaceService {
             ClientProfile clientProfile = new ClientProfile();
             clientProfile.setHttpProfile(httpProfile);
             FaceidClient client = new FaceidClient(cred, "", clientProfile);
-            String params = "{\"RuleId\":\"0\"}";
+            String params = "{\"RuleId\":\""+RuleId+"\"}";
             DetectAuthRequest req = DetectAuthRequest.fromJsonString(params, DetectAuthRequest.class);
     //        DetectAuthRequest req = new DetectAuthRequest();
             DetectAuthResponse resp = client.DetectAuth(req);