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