fix(scheduler): bind IDoctorTrendRepository via [FromServices] on trend endpoints
Three Doctor trend endpoints (/trends/checks/{checkId}, /trends/categories/{category},
/trends/degrading) were missing the [FromServices] attribute on the
IDoctorTrendRepository? parameter, causing ASP.NET minimal-APIs to attempt model
binding from route/query instead of resolving from DI. Verified fix with HTTP 200
responses against all four trend endpoints via the gateway.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -250,7 +250,7 @@ public sealed class DoctorJobPlugin : ISchedulerJobPlugin
|
||||
string checkId,
|
||||
DateTimeOffset? from,
|
||||
DateTimeOffset? to,
|
||||
IDoctorTrendRepository? trendRepository,
|
||||
[FromServices] IDoctorTrendRepository? trendRepository,
|
||||
TimeProvider timeProvider) =>
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(checkId))
|
||||
@@ -285,7 +285,7 @@ public sealed class DoctorJobPlugin : ISchedulerJobPlugin
|
||||
string category,
|
||||
DateTimeOffset? from,
|
||||
DateTimeOffset? to,
|
||||
IDoctorTrendRepository? trendRepository,
|
||||
[FromServices] IDoctorTrendRepository? trendRepository,
|
||||
TimeProvider timeProvider) =>
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(category))
|
||||
@@ -320,7 +320,7 @@ public sealed class DoctorJobPlugin : ISchedulerJobPlugin
|
||||
DateTimeOffset? from,
|
||||
DateTimeOffset? to,
|
||||
double? threshold,
|
||||
IDoctorTrendRepository? trendRepository,
|
||||
[FromServices] IDoctorTrendRepository? trendRepository,
|
||||
TimeProvider timeProvider) =>
|
||||
{
|
||||
if (trendRepository is null)
|
||||
|
||||
Reference in New Issue
Block a user