feat: Добавил генерацию api документации для git
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 10s
🚀 Create and publish a Docker image / Build & publish backend image (push) Successful in 28s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Successful in 14s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 9s
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 10s
🚀 Create and publish a Docker image / Build & publish backend image (push) Successful in 28s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Successful in 14s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 9s
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
|
||||
UniVerse — backend (ASP.NET Core) для университетской платформы расписания, лекций, отзывов и геймификации.
|
||||
|
||||
[Документация API](backend/UniVerse.Api/openapi.v1.json)
|
||||
[Документация бекнда](docs/backend.md)
|
||||
|
||||
## Что внутри
|
||||
|
||||
- Расписание/события и сущности: курсы, лекции, аудитории (locations)
|
||||
|
||||
@@ -18,6 +18,8 @@ using UniVerse.Infrastructure.Notifications;
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
var useAspire = builder.Configuration.GetValue<bool>("Aspire:Enabled");
|
||||
var isOpenApiGeneration = AppDomain.CurrentDomain.GetAssemblies()
|
||||
.Any(assembly => assembly.GetName().Name == "GetDocument.Insider");
|
||||
|
||||
if (useAspire)
|
||||
{
|
||||
@@ -98,10 +100,13 @@ builder.Services.AddTransient<NotificationJob>();
|
||||
builder.Services.Configure<EmailNotificationOptions>(builder.Configuration.GetSection("Email:Smtp"));
|
||||
|
||||
builder.Services.AddQuartz();
|
||||
if (!isOpenApiGeneration)
|
||||
{
|
||||
builder.Services.AddQuartzHostedService(options =>
|
||||
{
|
||||
options.WaitForJobsToComplete = true;
|
||||
});
|
||||
}
|
||||
|
||||
// --- HTTP Clients ---
|
||||
builder.Services.AddHttpClient<ILlmClient, LlmClient>(client =>
|
||||
@@ -117,8 +122,11 @@ builder.Services.AddHttpClient<IModeusApiClient, ModeusApiClient>(client =>
|
||||
});
|
||||
|
||||
// --- Background Services ---
|
||||
if (!isOpenApiGeneration)
|
||||
{
|
||||
builder.Services.AddHostedService<LlmProcessingBackgroundService>();
|
||||
builder.Services.AddHostedService<AchievementCatalogHostedService>();
|
||||
}
|
||||
|
||||
// --- Controllers ---
|
||||
builder.Services.AddControllers()
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<AllowMissingPrunePackageData>true</AllowMissingPrunePackageData>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<OpenApiGenerateDocumentsOnBuild>true</OpenApiGenerateDocumentsOnBuild>
|
||||
<OpenApiDocumentsDirectory>$(BaseIntermediateOutputPath)openapi</OpenApiDocumentsDirectory>
|
||||
<OpenApiGenerateDocumentsOptions>--file-name openapi</OpenApiGenerateDocumentsOptions>
|
||||
<!-- Suppress warnings for public members without XML docs -->
|
||||
<NoWarn>$(NoWarn);1591</NoWarn>
|
||||
</PropertyGroup>
|
||||
@@ -39,4 +42,14 @@
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<Target
|
||||
Name="CopyGeneratedOpenApiDocument"
|
||||
AfterTargets="Build"
|
||||
Condition="Exists('$(OpenApiDocumentsDirectory)/openapi.json')">
|
||||
<Copy
|
||||
SourceFiles="$(OpenApiDocumentsDirectory)/openapi.json"
|
||||
DestinationFiles="$(MSBuildProjectDirectory)/openapi.v1.json"
|
||||
SkipUnchangedFiles="true" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user