Add image generation (#2)
* Add image generation * Optimise for minimal memory * Added a new ui * Add support for esp
This commit was merged in pull request #2.
This commit is contained in:
18
HomeApi/Handlers/DepartureBoard.cs
Normal file
18
HomeApi/Handlers/DepartureBoard.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using HomeApi.Integration;
|
||||
using HomeApi.Models;
|
||||
using MediatR;
|
||||
|
||||
namespace HomeApi.Handlers;
|
||||
|
||||
public static class DepartureBoard
|
||||
{
|
||||
public record Command : IRequest<List<TimeTable>>;
|
||||
|
||||
public class Handler(IDepartureBoardService departureBoardService) : IRequestHandler<Command, List<TimeTable>>
|
||||
{
|
||||
public async Task<List<TimeTable>> Handle(Command request, CancellationToken cancellationToken)
|
||||
{
|
||||
return await departureBoardService.GetDepartureBoard() ?? new List<TimeTable>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user