dingxin 6 anos atrás
pai
commit
697a48b54c

+ 12
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/FaceController.java Ver arquivo

@@ -52,4 +52,16 @@ public class FaceController {
52 52
         return responseBean;
53 53
     }
54 54
 
55
+    @ApiOperation(value = "获取当前已录入人脸信息", notes = "获取当前已录入人脸信息")
56
+    @ApiImplicitParams({
57
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
58
+    })
59
+    @RequestMapping(value = "/getUserIdFace",method = RequestMethod.GET)
60
+    public Object getTaFaceByUserId(HttpSession session){
61
+        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
62
+        Integer userId = userElement.getId();
63
+        ResponseBean responseBean = faceServicel.getTaFaceByUserId(userId );
64
+        return responseBean;
65
+    }
66
+
55 67
 }

+ 7
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/FaceServiceI.java Ver arquivo

@@ -18,4 +18,11 @@ public interface FaceServiceI {
18 18
      * @return
19 19
      */
20 20
     ResponseBean upDateFace(Integer userId , MultipartFile uploadFile);
21
+
22
+    /**
23
+     * 当前登入人是否有人脸信息
24
+     * @param userId
25
+     * @return
26
+     */
27
+    ResponseBean getTaFaceByUserId(Integer userId);
21 28
 }

+ 14
- 5
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/FaceServicelimpl.java Ver arquivo

@@ -1,6 +1,4 @@
1 1
 package com.community.huiju.service.impl;
2
-
3
-import com.alibaba.fastjson.JSONArray;
4 2
 import com.alibaba.fastjson.JSONObject;
5 3
 import com.community.commom.ailiyun.AESDecode;
6 4
 import com.community.commom.constant.Constant;
@@ -18,11 +16,8 @@ import org.springframework.beans.factory.annotation.Autowired;
18 16
 import org.springframework.stereotype.Service;
19 17
 import org.springframework.transaction.annotation.Transactional;
20 18
 import org.springframework.web.multipart.MultipartFile;
21
-
22 19
 import java.io.IOException;
23 20
 import java.util.Date;
24
-import java.util.HashMap;
25
-import java.util.Map;
26 21
 
27 22
 @Service("faceServicel")
28 23
 @Transactional
@@ -181,4 +176,18 @@ public class FaceServicelimpl implements FaceServiceI {
181 176
     }
182 177
 
183 178
 
179
+    @Override
180
+    public ResponseBean getTaFaceByUserId(Integer userId) {
181
+        ResponseBean responseBean= new ResponseBean();
182
+        TaFace face = taFaceMapper.getByUserId(userId);
183
+            if (null!= face){
184
+            responseBean.addSuccess(face);
185
+            return responseBean;
186
+        }
187
+        responseBean.addError("当前用户暂无人脸图片");
188
+        return responseBean;
189
+
190
+    }
191
+
192
+
184 193
 }