feat 批量获取人脸照
This commit is contained in:
@@ -123,5 +123,16 @@ public class GainfosController : ControllerBase
|
|||||||
{
|
{
|
||||||
return await _gainfoService.GetFaceByUserCodeAsync(userCode);
|
return await _gainfoService.GetFaceByUserCodeAsync(userCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批量获取人脸照片
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userCodes"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("face/{userCodes}")]
|
||||||
|
public async Task<List<string>> GetFaceByUserCodesAsync([FromQuery] List<string> userCodes)
|
||||||
|
{
|
||||||
|
return await _gainfoService.GetFaceByUserCodesAsync(userCodes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,4 +24,6 @@ public interface IGainfoService : IScopeDependency
|
|||||||
Task<IActionResult> GetFaceAsync(string token);
|
Task<IActionResult> GetFaceAsync(string token);
|
||||||
|
|
||||||
Task<string> GetFaceByUserCodeAsync(string userCode);
|
Task<string> GetFaceByUserCodeAsync(string userCode);
|
||||||
|
|
||||||
|
Task<List<string>> GetFaceByUserCodesAsync(List<string> userCodes);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -328,4 +328,15 @@ public class GainfoService : IGainfoService
|
|||||||
return faceUrl + token;
|
return faceUrl + token;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
public async Task<List<string>> GetFaceByUserCodesAsync(List<string> userCodes)
|
||||||
|
{
|
||||||
|
var faces = new List<string>();
|
||||||
|
|
||||||
|
foreach (var userCode in userCodes)
|
||||||
|
{
|
||||||
|
var faceUrl = await GetFaceByUserCodeAsync(userCode);
|
||||||
|
faces.Add(faceUrl);
|
||||||
|
}
|
||||||
|
return faces;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user