dingxin 6 years ago
parent
commit
697a48b54c

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

52
         return responseBean;
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 View File

18
      * @return
18
      * @return
19
      */
19
      */
20
     ResponseBean upDateFace(Integer userId , MultipartFile uploadFile);
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 View File

1
 package com.community.huiju.service.impl;
1
 package com.community.huiju.service.impl;
2
-
3
-import com.alibaba.fastjson.JSONArray;
4
 import com.alibaba.fastjson.JSONObject;
2
 import com.alibaba.fastjson.JSONObject;
5
 import com.community.commom.ailiyun.AESDecode;
3
 import com.community.commom.ailiyun.AESDecode;
6
 import com.community.commom.constant.Constant;
4
 import com.community.commom.constant.Constant;
18
 import org.springframework.stereotype.Service;
16
 import org.springframework.stereotype.Service;
19
 import org.springframework.transaction.annotation.Transactional;
17
 import org.springframework.transaction.annotation.Transactional;
20
 import org.springframework.web.multipart.MultipartFile;
18
 import org.springframework.web.multipart.MultipartFile;
21
-
22
 import java.io.IOException;
19
 import java.io.IOException;
23
 import java.util.Date;
20
 import java.util.Date;
24
-import java.util.HashMap;
25
-import java.util.Map;
26
 
21
 
27
 @Service("faceServicel")
22
 @Service("faceServicel")
28
 @Transactional
23
 @Transactional
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
 }