日历域把日历事件(Event)及其邀请响应抽象为 ICalendarService,消费方通过 DI 注入接口即可,无需关心具体供应商。
统一接口
ICalendarService(命名空间 Bitzsoft.Integrations.Calendar)定义 7 个方法:
| 方法 | 说明 |
|---|---|
CreateEventAsync | 创建日历事件 |
GetEventAsync | 查询单个日历事件详情 |
UpdateEventAsync | 更新日历事件 |
DeleteEventAsync | 删除日历事件 |
ListEventsAsync | 查询日历事件列表 |
AcceptInvitationAsync | 接受事件邀请 |
DeclineInvitationAsync | 拒绝事件邀请 |
接口还暴露 ProviderName 属性,返回运行时供应商名称(如 "Google")。
包结构
Bitzsoft.Integrations.Calendar/ ← 抽象层Bitzsoft.Integrations.Calendar.All/ ← 聚合包(拉入全部 2 家)Bitzsoft.Integrations.Calendar.Google/ ← Google CalendarBitzsoft.Integrations.Calendar.Microsoft365/ ← Microsoft 365 Calendar供应商清单
| 供应商 | Provider ID | 鉴权 | 文档 |
|---|---|---|---|
| Google Calendar | google | OAuth2 Access Token Bearer / API Key | google.mdx |
| Microsoft 365 Calendar | microsoft-365 | Azure AD Client Credentials Bearer(Microsoft Graph) | microsoft365.mdx |