Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Optivulcan library to 0.2.3 #6

Merged
merged 3 commits into from
Dec 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public GetBranchesRequestHandler(IBranchRepository branchRepository)
return branchesFromCache.Branches;

var schoolModel = await SchoolApi.GetSchoolModel(request.SchoolId);
var newSchoolBranches = await Api.GetBranchListAsync(schoolModel.TimetableUrl);
var newSchoolBranches = await OptivulcanApi.GetBranches(schoolModel.TimetableUrl!);
var branchCache = new BranchCache
{
Branches = newSchoolBranches
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public GetTimetableRequestHandler(ITimetableRepository timetableRepository)
return timetableFromCache.Timetable;

var schoolModel = await SchoolApi.GetSchoolModel(request.SchoolId);
var newTimetable = await Api.GetTimetableAsync(schoolModel.TimetableUrl + request.ShortPath);
var newTimetable = await OptivulcanApi.GetTimetable(schoolModel.TimetableUrl + request.ShortPath);

var timetableCache = new TimetableCache
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Autofac" Version="6.3.0"/>
<PackageReference Include="MediatR" Version="9.0.0"/>
<PackageReference Include="Optivulcan" Version="0.1.1"/>
<PackageReference Include="Autofac" Version="6.3.0" />
<PackageReference Include="MediatR" Version="9.0.0" />
<PackageReference Include="Optivulcan" Version="0.2.3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Vulder.Timetable.Core\Vulder.Timetable.Core.csproj"/>
<ProjectReference Include="..\Vulder.Timetable.Infrastructure\Vulder.Timetable.Infrastructure.csproj"/>
<ProjectReference Include="..\Vulder.Timetable.Core\Vulder.Timetable.Core.csproj" />
<ProjectReference Include="..\Vulder.Timetable.Infrastructure\Vulder.Timetable.Infrastructure.csproj" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/Vulder.Timetable.Core/Vulder.Timetable.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Optivulcan" Version="0.1.1"/>
<PackageReference Include="Vulder.SharedKernel" Version="0.1.6"/>
<PackageReference Include="Optivulcan" Version="0.2.3" />
<PackageReference Include="Vulder.SharedKernel" Version="0.1.6" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using System.Text.Json;
using StackExchange.Redis;
using Vulder.Timetable.Core.ProjectAggregate.Branch;
using Vulder.Timetable.Infrastructure.Redis.Interfaces;
Expand All @@ -16,7 +16,7 @@ public BranchRepository(RedisContext context)

public async Task Create(Guid schoolId, BranchCache branch)
{
await Branches.StringSetAsync(schoolId.ToString(), JsonConvert.SerializeObject(branch));
await Branches.StringSetAsync(schoolId.ToString(), JsonSerializer.Serialize(branch));
}

public async Task<BranchCache?> GetBranchById(Guid schoolId)
Expand All @@ -25,9 +25,9 @@ public async Task Create(Guid schoolId, BranchCache branch)
{
var branch = await Branches.StringGetAsync(schoolId.ToString());

return branch.ToString() == null ? null : JsonConvert.DeserializeObject<BranchCache>(branch.ToString());
return branch.ToString() == null ? null : JsonSerializer.Deserialize<BranchCache>(branch.ToString());
}
catch (JsonSerializationException)
catch (JsonException)
{
return null;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using System.Text.Json;
using StackExchange.Redis;
using Vulder.Timetable.Core.ProjectAggregate.Timetable;
using Vulder.Timetable.Infrastructure.Redis.Interfaces;
Expand All @@ -16,7 +16,7 @@ public TimetableRepository(RedisContext context)

public async Task Create(Guid? schoolId, string? className, TimetableCache timetable)
{
await Timetables.StringSetAsync(GetTimetableKey(schoolId, className), JsonConvert.SerializeObject(timetable));
await Timetables.StringSetAsync(GetTimetableKey(schoolId, className), JsonSerializer.Serialize(timetable));
}

public async Task<TimetableCache?> GetTimetableById(Guid? schoolId, string? className)
Expand All @@ -27,9 +27,9 @@ public async Task Create(Guid? schoolId, string? className, TimetableCache timet

return timetable.ToString() == null
? null
: JsonConvert.DeserializeObject<TimetableCache>(timetable.ToString());
: JsonSerializer.Deserialize<TimetableCache>(timetable.ToString());
}
catch (JsonSerializationException)
catch (JsonException)
{
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Autofac" Version="6.3.0"/>
<PackageReference Include="Flurl" Version="3.0.2"/>
<PackageReference Include="Flurl.Http" Version="3.2.0"/>
<PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.2.0"/>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1"/>
<PackageReference Include="Optivulcan" Version="0.1.1"/>
<PackageReference Include="StackExchange.Redis" Version="2.2.88"/>
<PackageReference Include="Vulder.SharedKernel" Version="0.1.6"/>
<PackageReference Include="Autofac" Version="6.3.0" />
<PackageReference Include="Flurl" Version="3.0.2" />
<PackageReference Include="Flurl.Http" Version="3.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Optivulcan" Version="0.2.3" />
<PackageReference Include="StackExchange.Redis" Version="2.2.88" />
<PackageReference Include="Vulder.SharedKernel" Version="0.1.6" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Vulder.Timetable.Core\Vulder.Timetable.Core.csproj"/>
<ProjectReference Include="..\Vulder.Timetable.Core\Vulder.Timetable.Core.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Vulder.Timetable.IntegrationTests.Controllers;
public class ControllersTest : IDisposable
{
private const string ClassName = "6A";
private const string ShortUrl = "%2Fplany%2Fs2.html";
private const string ShortUrl = "/plany/o1.html";
private readonly GetSchoolResponse _schoolTestModel;
private readonly WireMockServer _server;

Expand Down