|
@@ -31,12 +31,12 @@ namespace TEAMModelOS.SDK.DI
|
|
|
//private readonly IWebHostEnvironment _environment;
|
|
|
public bool check = true;
|
|
|
private SnowflakeId _snowflakeId;
|
|
|
- private readonly IHttpClientFactory _httpClient;
|
|
|
+ private readonly HttpClient _httpClient;
|
|
|
|
|
|
//private readonly IConfiguration _configuration;
|
|
|
// private readonly DI.DingDing _dingDing;
|
|
|
//public readonly Option _option;
|
|
|
- public ScsStudyApisService(AzureCosmosFactory azureCosmos, DingDing dingDing, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis, IHttpClientFactory httpClient, SnowflakeId snowflakeId)
|
|
|
+ public ScsStudyApisService(AzureCosmosFactory azureCosmos, DingDing dingDing, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis, HttpClient httpClient, SnowflakeId snowflakeId)
|
|
|
{
|
|
|
_azureCosmos = azureCosmos;
|
|
|
_dingDing = dingDing;
|
|
@@ -507,32 +507,28 @@ namespace TEAMModelOS.SDK.DI
|
|
|
parameterMap.Add("Tid", $"{tid}");
|
|
|
ScsResult result = new ScsResult { bizcode = Code, title = "5.3.1.11获取跳转学员信息,用于sso单点,后端验证。" };
|
|
|
try
|
|
|
- {
|
|
|
- ///{“result”:true,”reason”:null,”content”:”{“PXID”:””,”TID”:””,”TeacherName”:””,”ProjectTitle”:””,”ProjectItemTitle”:””,”CityName”:””,
|
|
|
- ///”DisName”:””,”SchoolName”:””,”Sex”:””,”PXXK”:””,”PXXD”:””,”TeacherXK”:””,”TeacherXD”:””,”Email”:””}”,”pagecount”:1}
|
|
|
- result = await ThirdApisService.Post(_httpClient,config.url, Code, config.passKey, config.privateKey, parameterMap);
|
|
|
- if (result.result)
|
|
|
- {
|
|
|
- teacher = result.content;
|
|
|
- }
|
|
|
- //await response.WriteAsJsonAsync(new { data = teacher });
|
|
|
- return (200, teacher);
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
{
|
|
|
var table = _azureStorage.GetCloudTableClient().GetTableReference("ScYxpt");
|
|
|
List<ScTeacher> teachers = await table.FindListByDict<ScTeacher>(new Dictionary<string, object> { { "PartitionKey", "ScTeacher" }, { "RowKey", $"{pxid}" } });
|
|
|
if (teachers.IsNotEmpty())
|
|
|
{
|
|
|
teacher = teachers[0].ToJsonString();
|
|
|
- return (200, teacher);
|
|
|
}
|
|
|
else {
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")},IES5.ScApisService:GetSingleTeacherByProject\n{ex.Message}\n{ex.StackTrace}\n{result.ToJsonString()}\n", GroupNames.醍摩豆服務運維群組);
|
|
|
- return (500, teacher);
|
|
|
+ result = await ThirdApisService.Post(_httpClient, config.url, Code, config.passKey, config.privateKey, parameterMap);
|
|
|
+ if (result.result)
|
|
|
+ {
|
|
|
+ teacher = result.content;
|
|
|
+ }
|
|
|
}
|
|
|
+ return (200, teacher);
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")},IES5.ScApisService:GetSingleTeacherByProject\n{ex.Message}\n{ex.StackTrace}\n{result.ToJsonString()}\n", GroupNames.醍摩豆服務運維群組);
|
|
|
+ return (500, teacher);
|
|
|
//await response.WriteAsJsonAsync(new { data = teacher });
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|