From a12423474cd5384898fb91dba49dea23931f7b9a Mon Sep 17 00:00:00 2001 From: 邱宇豪 <qyh123230312> Date: 星期四, 26 十月 2023 11:34:09 +0800 Subject: [PATCH] 20231026_qiuyh_调整磨具监测 --- hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/controller/FaceController.java | 31 +++++++++++++++++++++++++++++-- 1 files changed, 29 insertions(+), 2 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 9f08aa7..2e948f2 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 @@ -12,6 +12,12 @@ 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") public class FaceController { @@ -75,9 +81,9 @@ } - @RequestMapping("deleteNotify") + @RequestMapping("/deleteNotify") public JSONObject deleteNotify(@RequestBody String mess){ - faceServer.deleteNotify(mess); + faceServer.removeNotify(mess); JSONObject jsonObject = new JSONObject(); jsonObject.put("code",0); jsonObject.put("msg","OK"); @@ -85,5 +91,26 @@ 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); + } + } + } + } -- Gitblit v1.9.3