|
|
@@ -24,9 +24,22 @@ namespace OASystem.API.Controllers
|
|
|
private readonly IConfiguration _config;
|
|
|
private readonly IQiYeWeChatApiService _qiYeWeChatApiService;
|
|
|
private readonly System.Net.Http.IHttpClientFactory _httpClientFactory;
|
|
|
- private readonly HotmailService _hotmailService;
|
|
|
-
|
|
|
- public AITestController(IHunyuanService hunyuanService, IDoubaoService doubaoService, ILogger<AITestController> logger, IQiYeWeChatApiService qiYeWeChatApiService, HotmailService hotmailService, System.Net.Http.IHttpClientFactory httpClientFactory, IConfiguration config)
|
|
|
+ private readonly HotmailService _hotmailService;
|
|
|
+ private readonly MicrosoftGraphMailboxService _microsoftGraphMailboxService;
|
|
|
+ private readonly MicrosoftGraphMailboxOptions _microsoftGraphMailboxOptions;
|
|
|
+
|
|
|
+
|
|
|
+ public AITestController(
|
|
|
+ IHunyuanService hunyuanService,
|
|
|
+ IDoubaoService doubaoService,
|
|
|
+ ILogger<AITestController> logger,
|
|
|
+ IQiYeWeChatApiService qiYeWeChatApiService,
|
|
|
+ HotmailService hotmailService,
|
|
|
+ System.Net.Http.IHttpClientFactory httpClientFactory,
|
|
|
+ IConfiguration config,
|
|
|
+ MicrosoftGraphMailboxService microsoftGraphMailboxService,
|
|
|
+ MicrosoftGraphMailboxOptions microsoftGraphMailboxOptions
|
|
|
+ )
|
|
|
{
|
|
|
_hunyuanService = hunyuanService;
|
|
|
_doubaoService = doubaoService;
|
|
|
@@ -35,6 +48,8 @@ namespace OASystem.API.Controllers
|
|
|
_hotmailService = hotmailService;
|
|
|
_httpClientFactory = httpClientFactory;
|
|
|
_config = config;
|
|
|
+ _microsoftGraphMailboxService = microsoftGraphMailboxService;
|
|
|
+ _microsoftGraphMailboxOptions = microsoftGraphMailboxOptions;
|
|
|
}
|
|
|
|
|
|
#region 企业微信发送邮件测试
|
|
|
@@ -613,7 +628,7 @@ namespace OASystem.API.Controllers
|
|
|
{
|
|
|
cacheEntry = JsonConvert.DeserializeObject<EmailAuthRedisCache>(json);
|
|
|
}
|
|
|
- catch (JsonException ex)
|
|
|
+ catch (System.Text.Json.JsonException ex)
|
|
|
{
|
|
|
_logger.LogWarning(ex, "Redis 键 {Key} 内容不是合法 JSON(应用 StringGetRawAsync + JSON,勿用 StringGetAsync<T>,后者为 BinaryFormatter)", key);
|
|
|
return BadRequest(new { message = "Redis 值为 JSON 文本时须用 StringGetRawAsync 再反序列化;StringGetAsync<T> 仅适用于 BinaryFormatter 写入的数据", detail = ex.Message });
|