From 1b3a14a25d8f5013158ef2842e9be0e24240f2b5 Mon Sep 17 00:00:00 2001 From: 张晓波 <bingbo1993@126.com> Date: 星期一, 30 十月 2023 08:52:26 +0800 Subject: [PATCH] 人脸 缓存同步菜单 --- hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/controller/FaceController.java | 65 ++++++++++++++++++++++++++++++++ 1 files changed, 65 insertions(+), 0 deletions(-) diff --git a/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/controller/FaceController.java b/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/controller/FaceController.java index 560b42d..e8aad12 100644 --- a/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/controller/FaceController.java +++ b/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/controller/FaceController.java @@ -5,10 +5,18 @@ import com.thhy.staff.modules.biz.face.entity.FaceResult; import com.thhy.staff.modules.biz.face.service.FaceDeviceService; import com.thhy.staff.modules.biz.face.service.FaceServer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Base64; @RestController @RequestMapping("face") @@ -58,4 +66,61 @@ jsonObject.put("success",true); return jsonObject; } + + @RequestMapping("/queryPer") + public BasicResult queryPer(String perId){ + faceServer.queryPer(perId); + return BasicResult.success(); + } + + @RequestMapping("/getPersonDetail") + public BasicResult getPersonDetail(@RequestBody String mess){ + Logger logger = LoggerFactory.getLogger(FaceController.class); + logger.info("查询结果"+mess); + return BasicResult.success(); + } + + + @RequestMapping("/deleteNotify") + public JSONObject deleteNotify(@RequestBody String mess){ + faceServer.removeNotify(mess); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("code",0); + jsonObject.put("msg","OK"); + jsonObject.put("success",true); + return jsonObject; + } + + @RequestMapping("/showFaceImg") + public void showFaceImg(String recordId, HttpServletResponse response){ + String oriStr = faceServer.queryOriStrById(recordId); + byte[] bytes = Base64.getDecoder().decode(oriStr); + OutputStream outputStream = null; + try { + outputStream = response.getOutputStream(); + outputStream.write(bytes); + } catch (IOException e) { + throw new RuntimeException(e); + } finally { + try { + if (outputStream!=null) { + outputStream.close(); + } + } catch (IOException e) { + throw new RuntimeException(e); + } + } + } + + @RequestMapping("/allPerson") + public JSONObject allPerson(@RequestBody String mess){ + faceServer.allPerson(mess); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("code",0); + jsonObject.put("msg","OK"); + jsonObject.put("success",true); + return jsonObject; + } + + } -- Gitblit v1.9.3