[backend/controllers] Inherit from ControllerBase instead of Controller as we do not need MVC View support
This commit is contained in:
parent
b7f89a0d97
commit
c6a2a99c1b
19 changed files with 19 additions and 19 deletions
|
@ -17,7 +17,7 @@ namespace Iceshrimp.Backend.Controllers;
|
||||||
[Tags("ActivityPub")]
|
[Tags("ActivityPub")]
|
||||||
[UseNewtonsoftJson]
|
[UseNewtonsoftJson]
|
||||||
[Produces("application/activity+json", "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"")]
|
[Produces("application/activity+json", "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"")]
|
||||||
public class ActivityPubController : Controller
|
public class ActivityPubController : ControllerBase
|
||||||
{
|
{
|
||||||
[HttpGet("/notes/{id}")]
|
[HttpGet("/notes/{id}")]
|
||||||
[AuthorizedFetch]
|
[AuthorizedFetch]
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace Iceshrimp.Backend.Controllers;
|
||||||
[SuppressMessage("ReSharper", "SuggestBaseTypeForParameterInConstructor",
|
[SuppressMessage("ReSharper", "SuggestBaseTypeForParameterInConstructor",
|
||||||
Justification = "We only have a DatabaseContext in our DI pool, not the base type")]
|
Justification = "We only have a DatabaseContext in our DI pool, not the base type")]
|
||||||
[Produces(MediaTypeNames.Application.Json)]
|
[Produces(MediaTypeNames.Application.Json)]
|
||||||
public class AdminController(DatabaseContext db) : Controller
|
public class AdminController(DatabaseContext db) : ControllerBase
|
||||||
{
|
{
|
||||||
[HttpPost("invites/generate")]
|
[HttpPost("invites/generate")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(InviteResponse))]
|
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(InviteResponse))]
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace Iceshrimp.Backend.Controllers;
|
||||||
[EnableRateLimiting("sliding")]
|
[EnableRateLimiting("sliding")]
|
||||||
[Produces(MediaTypeNames.Application.Json)]
|
[Produces(MediaTypeNames.Application.Json)]
|
||||||
[Route("/api/iceshrimp/v1/auth")]
|
[Route("/api/iceshrimp/v1/auth")]
|
||||||
public class AuthController(DatabaseContext db, UserService userSvc) : Controller
|
public class AuthController(DatabaseContext db, UserService userSvc) : ControllerBase
|
||||||
{
|
{
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Authenticate]
|
[Authenticate]
|
||||||
|
|
|
@ -16,7 +16,7 @@ public class DriveController(
|
||||||
[SuppressMessage("ReSharper", "SuggestBaseTypeForParameterInConstructor")]
|
[SuppressMessage("ReSharper", "SuggestBaseTypeForParameterInConstructor")]
|
||||||
IOptionsSnapshot<Config.StorageSection> options,
|
IOptionsSnapshot<Config.StorageSection> options,
|
||||||
ILogger<DriveController> logger
|
ILogger<DriveController> logger
|
||||||
) : Controller
|
) : ControllerBase
|
||||||
{
|
{
|
||||||
[EnableCors("drive")]
|
[EnableCors("drive")]
|
||||||
[HttpGet("/files/{accessKey}")]
|
[HttpGet("/files/{accessKey}")]
|
||||||
|
|
|
@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||||
namespace Iceshrimp.Backend.Controllers;
|
namespace Iceshrimp.Backend.Controllers;
|
||||||
|
|
||||||
[Produces(MediaTypeNames.Application.Json)]
|
[Produces(MediaTypeNames.Application.Json)]
|
||||||
public class FallbackController : Controller
|
public class FallbackController : ControllerBase
|
||||||
{
|
{
|
||||||
[ProducesResponseType(StatusCodes.Status501NotImplemented, Type = typeof(ErrorResponse))]
|
[ProducesResponseType(StatusCodes.Status501NotImplemented, Type = typeof(ErrorResponse))]
|
||||||
public IActionResult FallbackAction()
|
public IActionResult FallbackAction()
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace Iceshrimp.Backend.Controllers;
|
||||||
[Route("/identicon/{id}")]
|
[Route("/identicon/{id}")]
|
||||||
[Produces(MediaTypeNames.Image.Png)]
|
[Produces(MediaTypeNames.Image.Png)]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(object))]
|
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(object))]
|
||||||
public class IdenticonController : Controller
|
public class IdenticonController : ControllerBase
|
||||||
{
|
{
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public async Task GetIdenticon(string id)
|
public async Task GetIdenticon(string id)
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class AccountController(
|
||||||
NotificationService notificationSvc,
|
NotificationService notificationSvc,
|
||||||
ActivityPub.ActivityRenderer activityRenderer,
|
ActivityPub.ActivityRenderer activityRenderer,
|
||||||
ActivityPub.ActivityDeliverService deliverSvc
|
ActivityPub.ActivityDeliverService deliverSvc
|
||||||
) : Controller
|
) : ControllerBase
|
||||||
{
|
{
|
||||||
[HttpGet("verify_credentials")]
|
[HttpGet("verify_credentials")]
|
||||||
[Authorize("read:accounts")]
|
[Authorize("read:accounts")]
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace Iceshrimp.Backend.Controllers.Mastodon;
|
||||||
[EnableRateLimiting("sliding")]
|
[EnableRateLimiting("sliding")]
|
||||||
[EnableCors("mastodon")]
|
[EnableCors("mastodon")]
|
||||||
[Produces(MediaTypeNames.Application.Json)]
|
[Produces(MediaTypeNames.Application.Json)]
|
||||||
public class AuthController(DatabaseContext db) : Controller
|
public class AuthController(DatabaseContext db) : ControllerBase
|
||||||
{
|
{
|
||||||
[HttpGet("/api/v1/apps/verify_credentials")]
|
[HttpGet("/api/v1/apps/verify_credentials")]
|
||||||
[Authenticate]
|
[Authenticate]
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace Iceshrimp.Backend.Controllers.Mastodon;
|
||||||
[EnableCors("mastodon")]
|
[EnableCors("mastodon")]
|
||||||
[EnableRateLimiting("sliding")]
|
[EnableRateLimiting("sliding")]
|
||||||
[Produces(MediaTypeNames.Application.Json)]
|
[Produces(MediaTypeNames.Application.Json)]
|
||||||
public class InstanceController(DatabaseContext db) : Controller
|
public class InstanceController(DatabaseContext db) : ControllerBase
|
||||||
{
|
{
|
||||||
[HttpGet("/api/v1/instance")]
|
[HttpGet("/api/v1/instance")]
|
||||||
public async Task<IActionResult> GetInstanceInfoV1([FromServices] IOptionsSnapshot<Config> config)
|
public async Task<IActionResult> GetInstanceInfoV1([FromServices] IOptionsSnapshot<Config> config)
|
||||||
|
|
|
@ -19,7 +19,7 @@ namespace Iceshrimp.Backend.Controllers.Mastodon;
|
||||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(AttachmentEntity))]
|
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(AttachmentEntity))]
|
||||||
[ProducesResponseType(StatusCodes.Status401Unauthorized, Type = typeof(MastodonErrorResponse))]
|
[ProducesResponseType(StatusCodes.Status401Unauthorized, Type = typeof(MastodonErrorResponse))]
|
||||||
[ProducesResponseType(StatusCodes.Status403Forbidden, Type = typeof(MastodonErrorResponse))]
|
[ProducesResponseType(StatusCodes.Status403Forbidden, Type = typeof(MastodonErrorResponse))]
|
||||||
public class MediaController(DriveService driveSvc) : Controller
|
public class MediaController(DriveService driveSvc) : ControllerBase
|
||||||
{
|
{
|
||||||
[HttpPost("/api/v1/media")]
|
[HttpPost("/api/v1/media")]
|
||||||
[HttpPost("/api/v2/media")]
|
[HttpPost("/api/v2/media")]
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace Iceshrimp.Backend.Controllers.Mastodon;
|
||||||
[EnableCors("mastodon")]
|
[EnableCors("mastodon")]
|
||||||
[EnableRateLimiting("sliding")]
|
[EnableRateLimiting("sliding")]
|
||||||
[Produces(MediaTypeNames.Application.Json)]
|
[Produces(MediaTypeNames.Application.Json)]
|
||||||
public class NotificationController(DatabaseContext db, NotificationRenderer notificationRenderer) : Controller
|
public class NotificationController(DatabaseContext db, NotificationRenderer notificationRenderer) : ControllerBase
|
||||||
{
|
{
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Authorize("read:notifications")]
|
[Authorize("read:notifications")]
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class SearchController(
|
||||||
UserRenderer userRenderer,
|
UserRenderer userRenderer,
|
||||||
NoteService noteSvc,
|
NoteService noteSvc,
|
||||||
ActivityPub.UserResolver userResolver
|
ActivityPub.UserResolver userResolver
|
||||||
) : Controller
|
) : ControllerBase
|
||||||
{
|
{
|
||||||
[HttpGet("/api/v2/search")]
|
[HttpGet("/api/v2/search")]
|
||||||
[Authorize("read:search")]
|
[Authorize("read:search")]
|
||||||
|
|
|
@ -26,7 +26,7 @@ public class StatusController(
|
||||||
NoteRenderer noteRenderer,
|
NoteRenderer noteRenderer,
|
||||||
NoteService noteSvc,
|
NoteService noteSvc,
|
||||||
IDistributedCache cache
|
IDistributedCache cache
|
||||||
) : Controller
|
) : ControllerBase
|
||||||
{
|
{
|
||||||
[HttpGet("{id}")]
|
[HttpGet("{id}")]
|
||||||
[Authenticate("read:statuses")]
|
[Authenticate("read:statuses")]
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace Iceshrimp.Backend.Controllers.Mastodon;
|
||||||
[Produces(MediaTypeNames.Application.Json)]
|
[Produces(MediaTypeNames.Application.Json)]
|
||||||
[ProducesResponseType(StatusCodes.Status401Unauthorized, Type = typeof(MastodonErrorResponse))]
|
[ProducesResponseType(StatusCodes.Status401Unauthorized, Type = typeof(MastodonErrorResponse))]
|
||||||
[ProducesResponseType(StatusCodes.Status403Forbidden, Type = typeof(MastodonErrorResponse))]
|
[ProducesResponseType(StatusCodes.Status403Forbidden, Type = typeof(MastodonErrorResponse))]
|
||||||
public class TimelineController(DatabaseContext db, NoteRenderer noteRenderer, IDistributedCache cache) : Controller
|
public class TimelineController(DatabaseContext db, NoteRenderer noteRenderer, IDistributedCache cache) : ControllerBase
|
||||||
{
|
{
|
||||||
[Authorize("read:statuses")]
|
[Authorize("read:statuses")]
|
||||||
[HttpGet("home")]
|
[HttpGet("home")]
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace Iceshrimp.Backend.Controllers;
|
||||||
[Route("/nodeinfo")]
|
[Route("/nodeinfo")]
|
||||||
[EnableCors("well-known")]
|
[EnableCors("well-known")]
|
||||||
[Produces(MediaTypeNames.Application.Json)]
|
[Produces(MediaTypeNames.Application.Json)]
|
||||||
public class NodeInfoController(IOptions<Config.InstanceSection> config, DatabaseContext db) : Controller
|
public class NodeInfoController(IOptions<Config.InstanceSection> config, DatabaseContext db) : ControllerBase
|
||||||
{
|
{
|
||||||
[HttpGet("2.1")]
|
[HttpGet("2.1")]
|
||||||
[HttpGet("2.0")]
|
[HttpGet("2.0")]
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace Iceshrimp.Backend.Controllers;
|
||||||
[EnableRateLimiting("sliding")]
|
[EnableRateLimiting("sliding")]
|
||||||
[Route("/api/iceshrimp/v1/note")]
|
[Route("/api/iceshrimp/v1/note")]
|
||||||
[Produces(MediaTypeNames.Application.Json)]
|
[Produces(MediaTypeNames.Application.Json)]
|
||||||
public class NoteController(DatabaseContext db, NoteService noteSvc) : Controller
|
public class NoteController(DatabaseContext db, NoteService noteSvc) : ControllerBase
|
||||||
{
|
{
|
||||||
[HttpGet("{id}")]
|
[HttpGet("{id}")]
|
||||||
[Authenticate]
|
[Authenticate]
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace Iceshrimp.Backend.Controllers;
|
||||||
[EnableRateLimiting("sliding")]
|
[EnableRateLimiting("sliding")]
|
||||||
[Route("/api/iceshrimp/v1/timeline")]
|
[Route("/api/iceshrimp/v1/timeline")]
|
||||||
[Produces(MediaTypeNames.Application.Json)]
|
[Produces(MediaTypeNames.Application.Json)]
|
||||||
public class TimelineController(DatabaseContext db, IDistributedCache cache) : Controller
|
public class TimelineController(DatabaseContext db, IDistributedCache cache) : ControllerBase
|
||||||
{
|
{
|
||||||
[HttpGet("home")]
|
[HttpGet("home")]
|
||||||
[Authenticate]
|
[Authenticate]
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace Iceshrimp.Backend.Controllers;
|
||||||
[EnableRateLimiting("sliding")]
|
[EnableRateLimiting("sliding")]
|
||||||
[Route("/api/iceshrimp/v1/user/{id}")]
|
[Route("/api/iceshrimp/v1/user/{id}")]
|
||||||
[Produces(MediaTypeNames.Application.Json)]
|
[Produces(MediaTypeNames.Application.Json)]
|
||||||
public class UserController(DatabaseContext db) : Controller
|
public class UserController(DatabaseContext db) : ControllerBase
|
||||||
{
|
{
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(UserResponse))]
|
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(UserResponse))]
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace Iceshrimp.Backend.Controllers;
|
||||||
[Tags("Federation")]
|
[Tags("Federation")]
|
||||||
[Route("/.well-known")]
|
[Route("/.well-known")]
|
||||||
[EnableCors("well-known")]
|
[EnableCors("well-known")]
|
||||||
public class WellKnownController(IOptions<Config.InstanceSection> config, DatabaseContext db) : Controller
|
public class WellKnownController(IOptions<Config.InstanceSection> config, DatabaseContext db) : ControllerBase
|
||||||
{
|
{
|
||||||
[HttpGet("webfinger")]
|
[HttpGet("webfinger")]
|
||||||
[Produces(MediaTypeNames.Application.Json)]
|
[Produces(MediaTypeNames.Application.Json)]
|
||||||
|
|
Loading…
Add table
Reference in a new issue