Archived
Private
Public Access
1
0

Added substitution date + default courses

This commit is contained in:
2023-05-01 12:54:05 +02:00
parent 0d83e9d75e
commit e55cbfe4c6
11 changed files with 98 additions and 6 deletions

View File

@@ -72,6 +72,9 @@ public class UnitsController : ControllerBase {
data.Substitutions.Add(substitution);
}
var date = html.DocumentNode.SelectNodes("//body/center[1]")[0].ChildNodes[1];
data.Date = DateTime.Parse(date.InnerHtml.Split(" ")[0]);
return data;
}

View File

@@ -1,6 +1,7 @@
namespace BetterIServ.Backend.Entities;
public struct UnitsData {
public DateTime Date { get; set; }
public IList<string> Notifications { get; set; }
public IList<Substitution> Substitutions { get; set; }
}

View File

@@ -1,3 +1,5 @@
using PuppeteerSharp;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
@@ -18,6 +20,8 @@ var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment()) {
await new BrowserFetcher().DownloadAsync(BrowserFetcher.DefaultChromiumRevision);
app.UseSwagger();
app.UseSwaggerUI();
}