fix 修复已知问题

This commit is contained in:
2025-06-11 17:03:07 +08:00
parent 9b93eef87d
commit 74667f7d39
11 changed files with 62 additions and 135 deletions

View File

@@ -1,10 +1,7 @@
using System.Text;
using Dlhis.Basic.Organization.Request;
using Dlhis.Basic.Organization.Request;
using Dlhis.Basic.Organization.Response;
using Dlhis.Basic.Organization.Services;
using HttpUtil;
using Kurisu.AspNetCore.DataAccess.Dto;
using Kurisu.AspNetCore.Utils.Extensions;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
@@ -19,12 +16,10 @@ namespace Dlhis.Basic.Organization.Controllers;
public class GainfoFacesController : ControllerBase
{
private readonly IGainfoFaceService _gainfoFaceService;
private readonly IHttpClientFactory _httpClientFactory;
public GainfoFacesController(IGainfoFaceService gainfoFaceService, IHttpClientFactory httpClientFactory)
public GainfoFacesController(IGainfoFaceService gainfoFaceService)
{
_gainfoFaceService = gainfoFaceService;
_httpClientFactory = httpClientFactory;
}
/// <summary>
@@ -48,31 +43,4 @@ public class GainfoFacesController : ControllerBase
{
return await _gainfoFaceService.GetUploadPageRecordsAsync(request);
}
[AllowAnonymous]
[HttpPost("test")]
public async Task<HikResponse<SimilarityData>> TestAsync(GainfoFaceValidateRequest request)
{
var client = _httpClientFactory.CreateClient("hik-openapi");
var body = request.ToJson(JsonExtensions.DefaultSetting);
var url = "/artemis/api/frs/v1/application/oneToOne";
var key = "27390082";
var secret = "MLl7Dv7p5Pgc9XYI3r4O";
HttpUtillib.SetPlatformInfo(key, secret, "10.32.0.10");
var r = HttpUtillib.HttpPost(url, body, 15);
return Encoding.UTF8.GetString(r).ToObject<HikResponse<SimilarityData>>();
// var headers = InitRequest(url, body, key, secret);
// client.DefaultRequestHeaders.Accept.Clear();
// client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(headers["Accept"]));
// var content = new StringContent(body, Encoding.UTF8, "application/json");
// foreach (var item in headers.Where(x => x.Key != "Accept").Where(x => x.Key != "Content-Type"))
// {
// content.Headers.Add(item.Key, item.Value);
// }
//
// var r = await client.PostAsync(url, content);
// return await r.Content.ReadAsStringAsync();
}
}