1
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
|
||||
|
||||
namespace Yes.Blog.Endpoints.Admins.Themes
|
||||
namespace Yes.Blog.Endpoints.Admins.Themes
|
||||
{
|
||||
public class GetThemesEndpoint : AdminEndpointScheme, IEndpoint
|
||||
public class GetThemesEndpoint : ThemeEndpointScheme, IEndpoint
|
||||
{
|
||||
public void Map(IEndpointRouteBuilder app) => app.MapGet("/themes", Handle);
|
||||
|
||||
|
||||
10
Yes.Blog/Endpoints/Admins/Themes/ThemeEndpointScheme.cs
Normal file
10
Yes.Blog/Endpoints/Admins/Themes/ThemeEndpointScheme.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Yes.Blog.Endpoints.Admins.Themes
|
||||
{
|
||||
public class ThemeEndpointScheme
|
||||
{
|
||||
public int Priority { get; set; } = 3;
|
||||
public string Prefix { get; set; } = "admin/api";
|
||||
|
||||
public string[] Tags { get; set; } = new[] { "Themes" };
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,15 @@
|
||||
namespace Yes.Blog.Endpoints.Admins.Themes
|
||||
{
|
||||
public class UpdateThemeEndpoint : AdminEndpointScheme, IEndpoint
|
||||
public class UpdateThemeEndpoint : ThemeEndpointScheme, IEndpoint
|
||||
{
|
||||
public void Map(IEndpointRouteBuilder app) => app.MapPut("/themes", Handle).WithRequestValidation<Request>();
|
||||
|
||||
public record Request(
|
||||
[Scalar.AspNetCore.ExcludeFromApiReference]
|
||||
internal record Request(
|
||||
string Theme
|
||||
);
|
||||
|
||||
public class RequestValidator : AbstractValidator<Request>
|
||||
internal class RequestValidator : AbstractValidator<Request>
|
||||
{
|
||||
public RequestValidator()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user