Added substitution date + default courses
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user