From 7aa2a071e064965649292c35d2b40885cd22ebe5 Mon Sep 17 00:00:00 2001
From: cheche <717840555@qq.com>
Date: Wed, 17 Jan 2024 10:42:18 +0800
Subject: [PATCH] =?UTF-8?q?feat=20=E6=89=B9=E9=87=8F=E8=8E=B7=E5=8F=96?=
=?UTF-8?q?=E4=BA=BA=E8=84=B8=E7=85=A7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Organization/Controllers/GainfosController.cs | 11 +++++++++++
.../Organization/Services/IGainfoService.cs | 2 ++
.../Organization/Services/Implements/GainfoService.cs | 11 +++++++++++
3 files changed, 24 insertions(+)
diff --git a/Src/Dlhis.Basic/Organization/Controllers/GainfosController.cs b/Src/Dlhis.Basic/Organization/Controllers/GainfosController.cs
index 56b26d43..ba5b825f 100644
--- a/Src/Dlhis.Basic/Organization/Controllers/GainfosController.cs
+++ b/Src/Dlhis.Basic/Organization/Controllers/GainfosController.cs
@@ -123,5 +123,16 @@ public class GainfosController : ControllerBase
{
return await _gainfoService.GetFaceByUserCodeAsync(userCode);
}
+
+ ///
+ /// 批量获取人脸照片
+ ///
+ ///
+ ///
+ [HttpGet("face/{userCodes}")]
+ public async Task> GetFaceByUserCodesAsync([FromQuery] List userCodes)
+ {
+ return await _gainfoService.GetFaceByUserCodesAsync(userCodes);
+ }
}
diff --git a/Src/Dlhis.Basic/Organization/Services/IGainfoService.cs b/Src/Dlhis.Basic/Organization/Services/IGainfoService.cs
index 77e812c1..dc895583 100644
--- a/Src/Dlhis.Basic/Organization/Services/IGainfoService.cs
+++ b/Src/Dlhis.Basic/Organization/Services/IGainfoService.cs
@@ -24,4 +24,6 @@ public interface IGainfoService : IScopeDependency
Task GetFaceAsync(string token);
Task GetFaceByUserCodeAsync(string userCode);
+
+ Task> GetFaceByUserCodesAsync(List userCodes);
}
diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs
index 9a7f6a44..3eee0824 100644
--- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs
+++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs
@@ -328,4 +328,15 @@ public class GainfoService : IGainfoService
return faceUrl + token;
});
}
+ public async Task> GetFaceByUserCodesAsync(List userCodes)
+ {
+ var faces = new List();
+
+ foreach (var userCode in userCodes)
+ {
+ var faceUrl = await GetFaceByUserCodeAsync(userCode);
+ faces.Add(faceUrl);
+ }
+ return faces;
+ }
}