mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Adding a provider api
This commit is contained in:
parent
976ffbaa41
commit
b7618c9c54
@ -52,8 +52,8 @@ namespace Kyoo
|
||||
services.AddDbContext<DatabaseContext>(options =>
|
||||
{
|
||||
options.UseLazyLoadingProxies()
|
||||
.UseSqlite(_configuration.GetConnectionString("Database"))
|
||||
.EnableSensitiveDataLogging();
|
||||
.UseSqlite(_configuration.GetConnectionString("Database"));
|
||||
//.EnableSensitiveDataLogging();
|
||||
//.UseLoggerFactory(LoggerFactory.Create(builder => builder.AddConsole()));
|
||||
});
|
||||
|
||||
|
27
Kyoo/Views/API/ProviderAPI.cs
Normal file
27
Kyoo/Views/API/ProviderAPI.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System.Collections.Generic;
|
||||
using Kyoo.Models;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Kyoo.API
|
||||
{
|
||||
[Route("api/provider")]
|
||||
[Route("api/providers")]
|
||||
[ApiController]
|
||||
public class ProviderAPI : ControllerBase
|
||||
{
|
||||
private readonly DatabaseContext _database;
|
||||
|
||||
public ProviderAPI(DatabaseContext database)
|
||||
{
|
||||
_database = database;
|
||||
}
|
||||
|
||||
[HttpGet("")]
|
||||
[Authorize(Policy="Read")]
|
||||
public ActionResult<IEnumerable<ProviderID>> Index()
|
||||
{
|
||||
return _database.Providers;
|
||||
}
|
||||
}
|
||||
}
|
@ -1 +1 @@
|
||||
Subproject commit 4ec71d48a9d48a054ea68594d3b8b4e2a09b33de
|
||||
Subproject commit e4cd29a489d5f20de42bb89f7db2c8299b7c5171
|
Loading…
x
Reference in New Issue
Block a user