mirror of
https://github.com/DrizzleTime/Foxel.git
synced 2026-06-09 09:29:36 +08:00
Refactor face clustering service and related interfaces
This commit is contained in:
28
Extensions/ApiExtensions.cs
Normal file
28
Extensions/ApiExtensions.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Scalar.AspNetCore;
|
||||
|
||||
namespace Foxel.Extensions;
|
||||
|
||||
/// <summary>
|
||||
/// API相关的扩展方法
|
||||
/// </summary>
|
||||
public static class ApiExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// 添加应用程序OpenAPI
|
||||
/// </summary>
|
||||
public static IServiceCollection AddApplicationOpenApi(this IServiceCollection services)
|
||||
{
|
||||
services.AddOpenApi(opt => { opt.AddDocumentTransformer<BearerSecuritySchemeTransformer>(); });
|
||||
return services;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 使用应用程序OpenAPI
|
||||
/// </summary>
|
||||
public static WebApplication UseApplicationOpenApi(this WebApplication app)
|
||||
{
|
||||
app.MapOpenApi();
|
||||
app.MapScalarApiReference();
|
||||
return app;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user