fix: align backend APIs and upload flow

This commit is contained in:
2026-09-15 14:10:55 +08:00
parent 32177a7293
commit 53e6195938
149 changed files with 4791 additions and 435 deletions
@@ -0,0 +1,16 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.EntityFrameworkCore;
namespace IM.InitCommon.Management;
public static class DeploymentCommands
{
public static bool ApplyMigrationsIfRequested(this WebApplication app, string[] args)
{
if (!args.Contains("--migrate")) return false;
using var scope = app.Services.CreateScope();
foreach (var probe in scope.ServiceProvider.GetServices<ManagementDbProbe>().Where(x => x.Context.Database.GetMigrations().Any()))
probe.Context.Database.Migrate();
Console.WriteLine("服务数据库迁移完成"); return true;
}
}