From 5357fcd46f03e4b0c4ec9402d9c4fe561ffd2ce6 Mon Sep 17 00:00:00 2001 From: 张磊磊 <201175954@qq.com> Date: 星期五, 08 十二月 2023 13:04:59 +0800 Subject: [PATCH] 判断条件 --- hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/controller/FaceController.java | 37 +++++++++++++++++++++++++++++++++++++ 1 files changed, 37 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 4508d37..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 @@ -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 { @@ -85,5 +91,36 @@ 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