Skip to content

Commit 79aed10

Browse files
committed
Release 1.1.5.0
1 parent 3ea18fa commit 79aed10

17 files changed

+34
-200
lines changed

MicrosoftGraphAPIBot/MicrosoftGraph/CalendarApi.cs

Lines changed: 0 additions & 138 deletions
This file was deleted.

MicrosoftGraphAPIBot/MicrosoftGraph/DefaultGraphApi.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public class DefaultGraphApi
2020
"offline_access user.read",
2121
OutlookApi.Scope,
2222
OneDriveApi.Scope,
23-
CalendarApi.Scope,
2423
PersonalContactsApi.Scope
2524
};
2625
public readonly static string Scope = string.Join(' ', scopes);

MicrosoftGraphAPIBot/MicrosoftGraph/FileApi.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public static async Task<DriveItem> CreateFolderAsync(IGraphServiceClient graphC
6969
/// <returns></returns>
7070
public static async Task DeleteDriveItemAsync(IGraphServiceClient graphClient, string itemId)
7171
{
72+
await Task.Delay(Utils.DeleteDelayTime);
7273
await graphClient.Me.Drive.Items[itemId]
7374
.Request()
7475
.DeleteAsync();

MicrosoftGraphAPIBot/MicrosoftGraph/OutlookApi.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ private static async Task SendMessageAsync(IGraphServiceClient graphClient, stri
206206
/// <returns></returns>
207207
private static async Task DeleteMessageAsync(IGraphServiceClient graphClient, string mailId)
208208
{
209+
await Task.Delay(Utils.DeleteDelayTime);
209210
await graphClient.Me.Messages[mailId].Request().DeleteAsync();
210211
}
211212

MicrosoftGraphAPIBot/MicrosoftGraph/PersonalContactsApi.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ public static async Task<Contact> CreateContact(IGraphServiceClient graphClient)
115115
/// <returns></returns>
116116
public static async Task DeleteContact(IGraphServiceClient graphClient, string Id)
117117
{
118+
await Task.Delay(Utils.DeleteDelayTime);
118119
await graphClient.Me.Contacts[Id]
119120
.Request()
120121
.DeleteAsync();

MicrosoftGraphAPIBot/MicrosoftGraphAPIBot.csproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
</ItemGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="HangFire.Core" Version="1.7.19" />
14-
<PackageReference Include="HangFire.SqlServer" Version="1.7.19" />
13+
<PackageReference Include="HangFire.Core" Version="1.7.24" />
14+
<PackageReference Include="HangFire.SqlServer" Version="1.7.24" />
1515
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.2">
1616
<PrivateAssets>all</PrivateAssets>
1717
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@@ -24,26 +24,26 @@
2424
<PrivateAssets>all</PrivateAssets>
2525
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2626
</PackageReference>
27-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.2" />
28-
<PackageReference Include="Microsoft.EntityFrameworkCore.Analyzers" Version="5.0.2" />
29-
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.2">
27+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.7" />
28+
<PackageReference Include="Microsoft.EntityFrameworkCore.Analyzers" Version="5.0.7" />
29+
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.7">
3030
<PrivateAssets>all</PrivateAssets>
3131
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3232
</PackageReference>
33-
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="5.0.2" />
34-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.2" />
33+
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="5.0.7" />
34+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.7" />
3535
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />
3636
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.1" />
3737
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
3838
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0" />
39-
<PackageReference Include="Microsoft.Graph" Version="3.21.0" />
39+
<PackageReference Include="Microsoft.Graph" Version="3.35.0" />
4040
<PackageReference Include="Serilog.Extensions.Logging.File" Version="2.0.0" />
41-
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.16.0.25740">
41+
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.25.0.33663">
4242
<PrivateAssets>all</PrivateAssets>
4343
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
4444
</PackageReference>
4545
<PackageReference Include="System.Linq.Async" Version="5.0.0" />
46-
<PackageReference Include="Telegram.Bot" Version="15.7.1" />
46+
<PackageReference Include="Telegram.Bot" Version="16.0.0" />
4747
<PackageReference Include="Text.Analyzers" Version="2.6.4">
4848
<PrivateAssets>all</PrivateAssets>
4949
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

MicrosoftGraphAPIBot/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ private static IHostBuilder CreateHostBuilder(string[] args) =>
5252
services.AddScoped<GraphApi, OutlookApi>();
5353
services.AddScoped<GraphApi, OneDriveApi>();
5454
services.AddScoped<GraphApi, PermissionsApi>();
55-
services.AddScoped<GraphApi, CalendarApi>();
5655
services.AddScoped<GraphApi, PersonalContactsApi>();
5756
services.AddTransient<ApiController>();
5857
services.AddTransient<ApiCallManager>();

MicrosoftGraphAPIBot/Services/CrontabService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public async Task StartAsync(CancellationToken cancellationToken)
2929
{
3030
try
3131
{
32+
Utils.DeleteDelayTime = configuration.GetValue<int>("DeleteDelayTime");
3233
StartReceiving();
3334
isStart = true;
3435
logger.LogInformation("Api call service is starting.");

MicrosoftGraphAPIBot/Utils.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ namespace MicrosoftGraphAPIBot
1818
{
1919
public static class Utils
2020
{
21+
public static int DeleteDelayTime { get; set; } = 30000;
22+
2123
/// <summary>
2224
/// 將 appsettings.json 中的 SQL 參數合併成連接字串
2325
/// </summary>
@@ -134,6 +136,7 @@ public static void Assert(bool condition, [CallerLineNumber] int lineNumber = 0,
134136
"CheckVerCron",
135137
"PushResultCron",
136138
"AdminPassword",
139+
"DeleteDelayTime",
137140
"Telegram:Token",
138141
"MSSQL:Host",
139142
"MSSQL:Port",

MicrosoftGraphBotTests/ApiCallManagerTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ public ApiCallManagerTests()
3030
services.AddScoped<GraphApi, OutlookApi>();
3131
services.AddScoped<GraphApi, OneDriveApi>();
3232
services.AddScoped<GraphApi, PermissionsApi>();
33-
services.AddScoped<GraphApi, CalendarApi>();
3433
services.AddScoped<GraphApi, PersonalContactsApi>();
3534
services.AddScoped<ApiController>();
3635
services.AddScoped<ApiCallManager>();

0 commit comments

Comments
 (0)