This commit is contained in:
2025-05-04 22:11:28 +08:00
parent 09afa239a6
commit b7eb0f9a68
69 changed files with 344 additions and 178 deletions

View File

@@ -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);

View 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" };
}
}

View File

@@ -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()
{