mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
parent
27ce0aa0e5
commit
fe1b7e9a5c
3 changed files with 26 additions and 2 deletions
|
|
@ -10,6 +10,10 @@ public class BaseController : Controller
|
|||
{
|
||||
protected readonly SeedService SeedService;
|
||||
|
||||
public BaseController()
|
||||
{
|
||||
}
|
||||
|
||||
protected BaseController(SeedService seedService)
|
||||
{
|
||||
SeedService = seedService;
|
||||
|
|
|
|||
19
src/FilterLists.Api/V1/Controllers/RulesController.cs
Normal file
19
src/FilterLists.Api/V1/Controllers/RulesController.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
using System.Threading.Tasks;
|
||||
using FilterLists.Services;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace FilterLists.Api.V1.Controllers
|
||||
{
|
||||
public class RulesController : BaseController
|
||||
{
|
||||
private readonly RuleService _ruleService;
|
||||
|
||||
public RulesController(RuleService ruleService)
|
||||
{
|
||||
_ruleService = ruleService;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> Index() => Json(new {Count = await _ruleService.GetCountAllActiveRules()});
|
||||
}
|
||||
}
|
||||
|
|
@ -20,9 +20,10 @@ public static void AddFilterListsServices(this IServiceCollection services, ICon
|
|||
options.UseMySql(configuration.GetConnectionString("FilterListsConnection"),
|
||||
b => b.MigrationsAssembly("FilterLists.Api"))
|
||||
.EnableSensitiveDataLogging());
|
||||
services.TryAddScoped<FilterListService>();
|
||||
services.TryAddScoped<SeedService>();
|
||||
services.TryAddScoped<SnapshotService>();
|
||||
services.TryAddScoped<FilterListService>();
|
||||
services.TryAddScoped<RuleService>();
|
||||
services.TryAddScoped<SeedService>();
|
||||
services.AddAutoMapper();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue