diff --git a/src/main/java/com/ycwl/basic/controller/printer/PrinterTvController.java b/src/main/java/com/ycwl/basic/controller/printer/PrinterTvController.java index 30296a5b..c1890662 100644 --- a/src/main/java/com/ycwl/basic/controller/printer/PrinterTvController.java +++ b/src/main/java/com/ycwl/basic/controller/printer/PrinterTvController.java @@ -197,5 +197,36 @@ public class PrinterTvController { return ApiResponse.success(resp); } + /** + * 通过人脸样本ID重定向到人脸图片URL + * + * @param faceSampleId 人脸样本ID + * @param response HTTP响应 + */ + @GetMapping("/faceSample/{faceSampleId}/url") + public void redirectToFaceSampleUrl(@PathVariable Long faceSampleId, HttpServletResponse response) throws Exception { + FaceSampleEntity faceSample = faceRepository.getFaceSample(faceSampleId); + if (faceSample == null || faceSample.getFaceUrl() == null) { + response.setStatus(404); + return; + } + response.sendRedirect(faceSample.getFaceUrl()); + } + + /** + * 通过人脸ID重定向到人脸图片URL + * + * @param faceId 人脸ID + * @param response HTTP响应 + */ + @GetMapping("/face/{faceId}/url") + public void redirectToFaceUrl(@PathVariable Long faceId, HttpServletResponse response) throws Exception { + FaceEntity face = faceRepository.getFace(faceId); + if (face == null || face.getFaceUrl() == null) { + response.setStatus(404); + return; + } + response.sendRedirect(face.getFaceUrl()); + } }