diff --git a/SharpRSS.API.Contracts/DTO/ApiKey.cs b/SharpRSS.API.Contracts/DTO/ApiKey.cs deleted file mode 100644 index 6c0a10b..0000000 --- a/SharpRSS.API.Contracts/DTO/ApiKey.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace SharpRSS.API.Contracts.DTO -{ - public record ApiKey() - { - public string Key { get; } - public string Usage { get; } - public KeyStatus Status { get; } - public string Message { get; } - } - - public enum KeyStatus - { - Active, - Disabled, - Unavailable - } -} \ No newline at end of file diff --git a/SharpRSS.API.Contracts/RssConnection.cs b/SharpRSS.API.Contracts/RssConnection.cs deleted file mode 100644 index d3bbf26..0000000 --- a/SharpRSS.API.Contracts/RssConnection.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace SharpRSS.API.Contracts -{ - public class RssConnection - { - public RssConnection(string connection, string apiKey) - { - // Identify with server - } - } -} \ No newline at end of file diff --git a/SharpRSS.API.Contracts/SharpRSS.API.Contracts.csproj b/SharpRSS.API.Contracts/SharpRSS.API.Contracts.csproj index 5cf2042..ccefe79 100644 --- a/SharpRSS.API.Contracts/SharpRSS.API.Contracts.csproj +++ b/SharpRSS.API.Contracts/SharpRSS.API.Contracts.csproj @@ -13,6 +13,7 @@ + diff --git a/SharpRSS.API/Controllers/AuthController.cs b/SharpRSS.API/Controllers/AuthController.cs new file mode 100644 index 0000000..d778a0b --- /dev/null +++ b/SharpRSS.API/Controllers/AuthController.cs @@ -0,0 +1,16 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace SharpRSS.API.Controllers +{ + [ApiController] + [Route("api/[controller]")] + public class AuthController : ControllerBase + { + [HttpGet("authenticate")] + public async Task> Authenticate() + { + return "Authenticated!"; + } + } +} \ No newline at end of file diff --git a/SharpRSS.API/Controllers/RssController.cs b/SharpRSS.API/Controllers/RssController.cs new file mode 100644 index 0000000..074e415 --- /dev/null +++ b/SharpRSS.API/Controllers/RssController.cs @@ -0,0 +1,11 @@ +using Microsoft.AspNetCore.Mvc; + +namespace SharpRSS.API.Controllers +{ + [ApiController] + [Route("api/[controller]")] + public class RssController + { + + } +} \ No newline at end of file diff --git a/SharpRSS.API/Controllers/WeatherForecastController.cs b/SharpRSS.API/Controllers/WeatherForecastController.cs deleted file mode 100644 index b532598..0000000 --- a/SharpRSS.API/Controllers/WeatherForecastController.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; - -namespace SharpRSS.API.Controllers -{ - [ApiController] - [Route("[controller]")] - public class WeatherForecastController : ControllerBase - { - private static readonly string[] Summaries = new[] - { - "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; - - private readonly ILogger _logger; - - public WeatherForecastController(ILogger logger) - { - _logger = logger; - } - - [HttpGet(Name = "GetWeatherForecast")] - public IEnumerable Get() - { - return Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)), - TemperatureC = Random.Shared.Next(-20, 55), - Summary = Summaries[Random.Shared.Next(Summaries.Length)] - }) - .ToArray(); - } - } -} \ No newline at end of file diff --git a/SharpRSS.API/Data/AuthenticationService.cs b/SharpRSS.API/Data/AuthenticationService.cs new file mode 100644 index 0000000..5ffd196 --- /dev/null +++ b/SharpRSS.API/Data/AuthenticationService.cs @@ -0,0 +1,7 @@ +namespace SharpRSS.API.Data +{ + public class AuthenticationService + { + + } +} \ No newline at end of file diff --git a/SharpRSS.API/Data/SharpRssService.cs b/SharpRSS.API/Data/SharpRssService.cs new file mode 100644 index 0000000..51fd029 --- /dev/null +++ b/SharpRSS.API/Data/SharpRssService.cs @@ -0,0 +1,7 @@ +namespace SharpRSS.API.Data +{ + public class SharpRssService + { + + } +} \ No newline at end of file diff --git a/SharpRSS.API/Program.cs b/SharpRSS.API/Program.cs index d671cc5..56522f5 100644 --- a/SharpRSS.API/Program.cs +++ b/SharpRSS.API/Program.cs @@ -5,6 +5,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Serilog; using Serilog.Formatting.Compact; +using SharpRSS.API.Data; using ToolQit; using ToolQit.Logging.Serilog; @@ -17,6 +18,8 @@ builder.Services.AddControllers(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); +builder.Services.AddScoped(); +builder.Services.AddScoped(); var app = builder.Build(); diff --git a/SharpRSS.API/SharpRSS.API.csproj b/SharpRSS.API/SharpRSS.API.csproj index 97932a7..f8bb911 100644 --- a/SharpRSS.API/SharpRSS.API.csproj +++ b/SharpRSS.API/SharpRSS.API.csproj @@ -22,4 +22,8 @@ + + + + diff --git a/SharpRSS.API/WeatherForecast.cs b/SharpRSS.API/WeatherForecast.cs deleted file mode 100644 index 1492547..0000000 --- a/SharpRSS.API/WeatherForecast.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace SharpRSS.API -{ - public class WeatherForecast - { - public DateOnly Date { get; set; } - - public int TemperatureC { get; set; } - - public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); - - public string? Summary { get; set; } - } -} \ No newline at end of file diff --git a/SharpRSS.Blazor/Data/WeatherForecast.cs b/SharpRSS.Blazor/Data/WeatherForecast.cs deleted file mode 100644 index 2defd12..0000000 --- a/SharpRSS.Blazor/Data/WeatherForecast.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace SharpRSS.Blazor.Data -{ - public class WeatherForecast - { - public DateOnly Date { get; set; } - - public int TemperatureC { get; set; } - - public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); - - public string? Summary { get; set; } - } -} \ No newline at end of file diff --git a/SharpRSS.Blazor/Data/WeatherForecastService.cs b/SharpRSS.Blazor/Data/WeatherForecastService.cs deleted file mode 100644 index 29928e6..0000000 --- a/SharpRSS.Blazor/Data/WeatherForecastService.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Linq; -using System.Threading.Tasks; - -namespace SharpRSS.Blazor.Data -{ - public class WeatherForecastService - { - private static readonly string[] Summaries = new[] - { - "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; - - public Task GetForecastAsync(DateOnly startDate) - { - return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - Date = startDate.AddDays(index), - TemperatureC = Random.Shared.Next(-20, 55), - Summary = Summaries[Random.Shared.Next(Summaries.Length)] - }).ToArray()); - } - } -} \ No newline at end of file diff --git a/SharpRSS.Blazor/Pages/Counter.razor b/SharpRSS.Blazor/Pages/Counter.razor deleted file mode 100644 index 175d3f3..0000000 --- a/SharpRSS.Blazor/Pages/Counter.razor +++ /dev/null @@ -1,19 +0,0 @@ -@page "/counter" - -Counter - -

Counter

- -

Current count: @currentCount

- - - -@code { - private int currentCount = 0; - - private void IncrementCount() - { - currentCount++; - } - -} \ No newline at end of file diff --git a/SharpRSS.Blazor/Pages/Error.cshtml.cs b/SharpRSS.Blazor/Pages/Error.cshtml.cs index 8c0ef6d..504991a 100644 --- a/SharpRSS.Blazor/Pages/Error.cshtml.cs +++ b/SharpRSS.Blazor/Pages/Error.cshtml.cs @@ -1,26 +1,28 @@ using System.Diagnostics; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.Extensions.Logging; -namespace SharpRSS.Blazor.Pages; - -[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] -[IgnoreAntiforgeryToken] -public class ErrorModel : PageModel +namespace SharpRSS.Blazor.Pages { - public string? RequestId { get; set; } - - public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); - - private readonly ILogger _logger; - - public ErrorModel(ILogger logger) + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] + [IgnoreAntiforgeryToken] + public class ErrorModel : PageModel { - _logger = logger; - } + public string? RequestId { get; set; } - public void OnGet() - { - RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; + public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + + private readonly ILogger _logger; + + public ErrorModel(ILogger logger) + { + _logger = logger; + } + + public void OnGet() + { + RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; + } } } \ No newline at end of file diff --git a/SharpRSS.Blazor/Pages/FetchData.razor b/SharpRSS.Blazor/Pages/FetchData.razor deleted file mode 100644 index aa89775..0000000 --- a/SharpRSS.Blazor/Pages/FetchData.razor +++ /dev/null @@ -1,50 +0,0 @@ -@page "/fetchdata" -@using SharpRSS.Blazor.Data -@inject WeatherForecastService ForecastService - -Weather forecast - -

Weather forecast

- -

This component demonstrates fetching data from a service.

- -@if (forecasts == null) -{ -

- Loading... -

-} -else -{ - - - - - - - - - - - @foreach (var forecast in forecasts) - { - - - - - - - } - -
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
-} - -@code { - private WeatherForecast[]? forecasts; - - protected override async Task OnInitializedAsync() - { - forecasts = await ForecastService.GetForecastAsync(DateOnly.FromDateTime(DateTime.Now)); - } - -} \ No newline at end of file diff --git a/SharpRSS.Blazor/Program.cs b/SharpRSS.Blazor/Program.cs index fc9943e..40fda78 100644 --- a/SharpRSS.Blazor/Program.cs +++ b/SharpRSS.Blazor/Program.cs @@ -4,7 +4,6 @@ using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using MudBlazor.Services; -using SharpRSS.Blazor.Data; using Serilog; using Serilog.Formatting.Compact; using ToolQit; @@ -17,7 +16,6 @@ builder.Logging.AddSerilog(); builder.Services.AddRazorPages(); builder.Services.AddServerSideBlazor(); builder.Services.AddMudServices(); -builder.Services.AddSingleton(); var app = builder.Build(); diff --git a/SharpRSS.Blazor/Shared/MainLayout.razor b/SharpRSS.Blazor/Shared/MainLayout.razor index 4948a0c..3925542 100644 --- a/SharpRSS.Blazor/Shared/MainLayout.razor +++ b/SharpRSS.Blazor/Shared/MainLayout.razor @@ -1,24 +1,32 @@ @inherits LayoutComponentBase - + SharpRSS.Blazor -
- + + + + SharpRSS + + + + + Home + + + @Body + + -
-
- About -
+@code +{ + readonly MudTheme _theme = new MudTheme(); + bool _drawerOpen = true; + bool _isDarkTheme = true; -
- @Body -
-
-
\ No newline at end of file + void ToggleDrawer() => _drawerOpen = !_drawerOpen; +} diff --git a/SharpRSS.Blazor/SharpRSS.Blazor.csproj b/SharpRSS.Blazor/SharpRSS.Blazor.csproj index 7699707..6b88525 100644 --- a/SharpRSS.Blazor/SharpRSS.Blazor.csproj +++ b/SharpRSS.Blazor/SharpRSS.Blazor.csproj @@ -21,4 +21,8 @@ + + + +