Fix db and fix endpoints

This commit is contained in:
2025-08-05 22:30:18 +07:00
parent 2dcbcc3ef2
commit 36529ae403
36 changed files with 5073 additions and 245 deletions

View File

@@ -229,4 +229,14 @@ public class AgentSummaryRepository : IAgentSummaryRepository
User = PostgreSqlMappers.Map(entity.User)
};
}
public async Task<IEnumerable<AgentSummary>> GetAllAgentWithRunningBots()
{
var agentSummaries = await _context.AgentSummaries
.Include(a => a.User)
.Where(a => _context.Bots.Any(b => b.UserId == a.UserId && b.Status == BotStatus.Up))
.ToListAsync();
return agentSummaries.Select(MapToDomain);
}
}