|
@@ -15,6 +15,9 @@ using System.Text;
|
|
using System.Net;
|
|
using System.Net;
|
|
using HTEXLib.COMM.Helpers;
|
|
using HTEXLib.COMM.Helpers;
|
|
using System.Net.Http.Json;
|
|
using System.Net.Http.Json;
|
|
|
|
+using TEAMModelOS.SDK;
|
|
|
|
+using TEAMModelBI.Filter;
|
|
|
|
+using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
|
namespace TEAMModelBI.Controllers.BIServer
|
|
namespace TEAMModelBI.Controllers.BIServer
|
|
{
|
|
{
|
|
@@ -31,14 +34,39 @@ namespace TEAMModelBI.Controllers.BIServer
|
|
private readonly IConfiguration _configuration;
|
|
private readonly IConfiguration _configuration;
|
|
|
|
|
|
private readonly IHttpClientFactory _http;
|
|
private readonly IHttpClientFactory _http;
|
|
|
|
+ private readonly CoreAPIHttpService _coreAPIHttpService;
|
|
|
|
|
|
- public BiServersController(AzureCosmosFactory azureCosmos, DingDing dingDing, IOptionsSnapshot<Option> option, IConfiguration configuration, IHttpClientFactory http)
|
|
|
|
|
|
+
|
|
|
|
+ public BiServersController(AzureCosmosFactory azureCosmos, DingDing dingDing, IOptionsSnapshot<Option> option, IConfiguration configuration, IHttpClientFactory http, CoreAPIHttpService coreAPIHttpService)
|
|
{
|
|
{
|
|
_azureCosmos = azureCosmos;
|
|
_azureCosmos = azureCosmos;
|
|
_dingDing = dingDing;
|
|
_dingDing = dingDing;
|
|
_option = option?.Value;
|
|
_option = option?.Value;
|
|
_configuration = configuration;
|
|
_configuration = configuration;
|
|
_http = http;
|
|
_http = http;
|
|
|
|
+ _coreAPIHttpService = coreAPIHttpService;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 通过手机号、醍摩豆账户、邮箱查询信息
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="request"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [AuthToken(Roles = "admin")]
|
|
|
|
+ [HttpPost("get-coreinfo")]
|
|
|
|
+ public async Task<IActionResult> GetCoreInfo(JsonElement jsonElement)
|
|
|
|
+ {
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ var content = new StringContent(jsonElement.ToString(), Encoding.UTF8, "application/json");
|
|
|
|
+ string json = await _coreAPIHttpService.GetUserInfos(content);
|
|
|
|
+ return Ok(new { state = 200, infos = json.ToObject<JsonElement>() });
|
|
|
|
+ }
|
|
|
|
+ catch (Exception ex)
|
|
|
|
+ {
|
|
|
|
+ await _dingDing.SendBotMsg($"BI, {_option} /biservers/get-coreinfo \n {ex.Message} {ex.StackTrace}", GroupNames.成都开发測試群組);
|
|
|
|
+ return BadRequest();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|