42 lines
1.3 KiB
C#
42 lines
1.3 KiB
C#
#pragma warning disable ASPDEPR002 // WithOpenApi is deprecated - will migrate to new OpenAPI approach
|
|
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Routing;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace StellaOps.Provcache.Api;
|
|
|
|
/// <summary>
|
|
/// Extension methods for mapping Provcache API endpoints.
|
|
/// </summary>
|
|
public static partial class ProvcacheEndpointExtensions
|
|
{
|
|
/// <summary>
|
|
/// Maps Provcache API endpoints to the specified route builder.
|
|
/// </summary>
|
|
/// <param name="endpoints">The endpoint route builder.</param>
|
|
/// <param name="prefix">The route prefix (default: "/v1/provcache").</param>
|
|
/// <returns>A route group builder for further customization.</returns>
|
|
public static RouteGroupBuilder MapProvcacheEndpoints(
|
|
this IEndpointRouteBuilder endpoints,
|
|
string prefix = "/v1/provcache")
|
|
{
|
|
var group = endpoints.MapGroup(prefix)
|
|
.WithTags("Provcache")
|
|
.WithOpenApi();
|
|
|
|
MapCoreEndpoints(group);
|
|
|
|
var proofsGroup = endpoints.MapGroup($"{prefix}/proofs")
|
|
.WithTags("Provcache Evidence")
|
|
.WithOpenApi();
|
|
|
|
MapProofEndpoints(proofsGroup);
|
|
|
|
return group;
|
|
}
|
|
}
|
|
#pragma warning restore ASPDEPR002
|