| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- namespace OASystem.API.OAMethodLib.MicrosoftGraphMailbox;
- /// <summary>
- /// Microsoft Graph 邮箱轮询(公共客户端 MSAL + 交互式首次登录)配置。
- /// </summary>
- public class MicrosoftGraphMailboxOptions
- {
- public const string SectionName = "MicrosoftGraphMailbox";
- /// <summary>
- /// 是否启用后台收件箱轮询。关闭时不初始化 MSAL、不弹浏览器。
- /// </summary>
- public bool Enabled { get; set; }
- /// <summary>
- /// Azure AD 应用程序(公共客户端)ID。
- /// </summary>
- public string ClientId { get; set; } = string.Empty;
- /// <summary>
- /// 租户,例如 common、organizations 或具体租户 GUID。
- /// </summary>
- public string Tenant { get; set; } = "common";
- /// <summary>
- /// 须在 Azure 门户中注册的公共客户端重定向 URI(与交互式登录一致)。
- /// </summary>
- public string RedirectUri { get; set; } = "http://localhost:55649";
- /// <summary>
- /// 轮询间隔(秒)。
- /// </summary>
- public int PollIntervalSeconds { get; set; } = 30;
- /// <summary>
- /// 每次拉取的邮件条数上限。
- /// </summary>
- public int TopMessages { get; set; } = 50;
- /// <summary>
- /// MSAL 令牌缓存目录;为空则使用 %LocalAppData%\OASystem\MicrosoftGraphMailbox。
- /// </summary>
- public string? CacheDirectory { get; set; }
- /// <summary>
- /// 令牌缓存文件名。
- /// </summary>
- public string CacheFileName { get; set; } = "msal_graph_mailbox_cache.bin";
- /// <summary>
- /// 启动并成功取 token 后是否调用 /me 打一条日志(便于确认账号)。
- /// </summary>
- public bool LogProfileOnStartup { get; set; } = true;
- /// <summary>
- /// 无新邮件时是否仍输出轮询心跳日志。
- /// </summary>
- public bool LogEachPollWhenEmpty { get; set; }
- }
|