本轮完成“考点与考场变更审批”原生迁移:
GET/POST/PATCH /api/admin/centers
PATCH /api/admin/center-change-requests/{id}
校级数据范围、班级管理员禁用
省市区县及结构化考场校验
正式档案和待审申请代码去重
多级工作流分配、通过与拒绝
终审时原子更新流程、审计、考点及考场
新增开关 ADMIN_NATIVE_CENTERS_ENABLED=false
This commit is contained in:
@@ -67,16 +67,30 @@ public static class NativeAdminReadEndpoints
|
||||
Execute(context, service.SaveWorkflowAsync(Token(context), businessType, body, cancellationToken)));
|
||||
}
|
||||
|
||||
if (!options.NativeNoticeManagementEnabled) return endpoints;
|
||||
endpoints.MapGet("/api/admin/notices", (HttpContext context, IAdminNoticeService service, CancellationToken cancellationToken) =>
|
||||
Execute(context, service.ListAsync(Token(context), cancellationToken)));
|
||||
endpoints.MapPost("/api/admin/notices", (HttpContext context, JsonObject body, IAdminNoticeService service, CancellationToken cancellationToken) =>
|
||||
Execute(context, service.CreateAsync(Token(context), body, cancellationToken)));
|
||||
endpoints.MapPatch("/api/admin/notices/{noticeId}", (HttpContext context, string noticeId, JsonObject body, IAdminNoticeService service, CancellationToken cancellationToken) =>
|
||||
Execute(context, service.UpdateAsync(Token(context), noticeId, body, cancellationToken)));
|
||||
endpoints.MapPatch("/api/admin/publications/{sourceType:regex(^(plan|qualification|admission|cutoff|reporting)$)}/{publicationId}",
|
||||
(HttpContext context, string sourceType, string publicationId, JsonObject body, IAdminNoticeService service, CancellationToken cancellationToken) =>
|
||||
Execute(context, service.UpdatePublicationVisibilityAsync(Token(context), sourceType, publicationId, body, cancellationToken)));
|
||||
if (options.NativeNoticeManagementEnabled)
|
||||
{
|
||||
endpoints.MapGet("/api/admin/notices", (HttpContext context, IAdminNoticeService service, CancellationToken cancellationToken) =>
|
||||
Execute(context, service.ListAsync(Token(context), cancellationToken)));
|
||||
endpoints.MapPost("/api/admin/notices", (HttpContext context, JsonObject body, IAdminNoticeService service, CancellationToken cancellationToken) =>
|
||||
Execute(context, service.CreateAsync(Token(context), body, cancellationToken)));
|
||||
endpoints.MapPatch("/api/admin/notices/{noticeId}", (HttpContext context, string noticeId, JsonObject body, IAdminNoticeService service, CancellationToken cancellationToken) =>
|
||||
Execute(context, service.UpdateAsync(Token(context), noticeId, body, cancellationToken)));
|
||||
endpoints.MapPatch("/api/admin/publications/{sourceType:regex(^(plan|qualification|admission|cutoff|reporting)$)}/{publicationId}",
|
||||
(HttpContext context, string sourceType, string publicationId, JsonObject body, IAdminNoticeService service, CancellationToken cancellationToken) =>
|
||||
Execute(context, service.UpdatePublicationVisibilityAsync(Token(context), sourceType, publicationId, body, cancellationToken)));
|
||||
}
|
||||
|
||||
if (options.NativeCentersEnabled)
|
||||
{
|
||||
endpoints.MapGet("/api/admin/centers", (HttpContext context, IAdminCenterService service, CancellationToken cancellationToken) =>
|
||||
Execute(context, service.GetAsync(Token(context), cancellationToken)));
|
||||
endpoints.MapPost("/api/admin/centers", (HttpContext context, JsonObject body, IAdminCenterService service, CancellationToken cancellationToken) =>
|
||||
Execute(context, service.CreateAsync(Token(context), body, cancellationToken)));
|
||||
endpoints.MapPatch("/api/admin/centers/{centerId}", (HttpContext context, string centerId, JsonObject body, IAdminCenterService service, CancellationToken cancellationToken) =>
|
||||
Execute(context, service.UpdateAsync(Token(context), centerId, body, cancellationToken)));
|
||||
endpoints.MapPatch("/api/admin/center-change-requests/{changeRequestId}", (HttpContext context, string changeRequestId, JsonObject body, IAdminCenterService service, CancellationToken cancellationToken) =>
|
||||
Execute(context, service.ReviewAsync(Token(context), changeRequestId, body, cancellationToken)));
|
||||
}
|
||||
return endpoints;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,8 @@ var adminMigrationOptions = AdminMigrationOptions.FromEnvironment(
|
||||
builder.Configuration.GetValue<bool>("AdminMigration:NativeOrganizationWritesEnabled"),
|
||||
builder.Configuration.GetValue<bool>("AdminMigration:NativeAccountBatchesEnabled"),
|
||||
builder.Configuration.GetValue<bool>("AdminMigration:NativeConfigurationEnabled"),
|
||||
builder.Configuration.GetValue<bool>("AdminMigration:NativeNoticeManagementEnabled"));
|
||||
builder.Configuration.GetValue<bool>("AdminMigration:NativeNoticeManagementEnabled"),
|
||||
builder.Configuration.GetValue<bool>("AdminMigration:NativeCentersEnabled"));
|
||||
builder.Services.AddEisInfrastructure(
|
||||
DatabaseOptions.FromEnvironment(applicationRoot, builder.Environment.IsProduction()),
|
||||
DocumentVerificationOptions.FromEnvironment(builder.Environment.IsProduction()),
|
||||
@@ -108,6 +109,7 @@ app.MapGet("/health/migration", async (LegacyApiProxy proxy, CancellationToken c
|
||||
nativeAccountBatchesEnabled = adminMigrationOptions.NativeAccountBatchesEnabled,
|
||||
nativeConfigurationEnabled = adminMigrationOptions.NativeConfigurationEnabled,
|
||||
nativeNoticeManagementEnabled = adminMigrationOptions.NativeNoticeManagementEnabled,
|
||||
nativeCentersEnabled = adminMigrationOptions.NativeCentersEnabled,
|
||||
nativeRoutes = (adminMigrationOptions.NativeReadsEnabled
|
||||
? new[] { "GET context", "GET dashboard", "GET schools", "GET school-organization", "GET admins", "GET exams" }
|
||||
: [])
|
||||
@@ -127,6 +129,9 @@ app.MapGet("/health/migration", async (LegacyApiProxy proxy, CancellationToken c
|
||||
.Concat(adminMigrationOptions.NativeNoticeManagementEnabled
|
||||
? new[] { "GET/POST/PATCH notices", "PATCH system publications" }
|
||||
: [])
|
||||
.Concat(adminMigrationOptions.NativeCentersEnabled
|
||||
? new[] { "GET/POST/PATCH centers", "PATCH center-change-requests" }
|
||||
: [])
|
||||
.ToArray()
|
||||
},
|
||||
features = MigrationFeatureCatalog.Current(authenticationOptions.NativeEnabled, candidateMigrationOptions.NativeEnabled)
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
"NativeOrganizationWritesEnabled": false,
|
||||
"NativeAccountBatchesEnabled": false,
|
||||
"NativeConfigurationEnabled": false,
|
||||
"NativeNoticeManagementEnabled": false
|
||||
"NativeNoticeManagementEnabled": false,
|
||||
"NativeCentersEnabled": false
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
|
||||
Reference in New Issue
Block a user