[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")]
|
||||
[UseNewtonsoftJson]
|
||||
[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}")]
|
||||
[AuthorizedFetch]
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace Iceshrimp.Backend.Controllers;
|
|||
[SuppressMessage("ReSharper", "SuggestBaseTypeForParameterInConstructor",
|
||||
Justification = "We only have a DatabaseContext in our DI pool, not the base type")]
|
||||
[Produces(MediaTypeNames.Application.Json)]
|
||||
public class AdminController(DatabaseContext db) : Controller
|
||||
public class AdminController(DatabaseContext db) : ControllerBase
|
||||
{
|
||||
[HttpPost("invites/generate")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(InviteResponse))]
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace Iceshrimp.Backend.Controllers;
|
|||
[EnableRateLimiting("sliding")]
|
||||
[Produces(MediaTypeNames.Application.Json)]
|
||||
[Route("/api/iceshrimp/v1/auth")]
|
||||
public class AuthController(DatabaseContext db, UserService userSvc) : Controller
|
||||
public class AuthController(DatabaseContext db, UserService userSvc) : ControllerBase
|
||||
{
|
||||
[HttpGet]
|
||||
[Authenticate]
|
||||
|
|
|
@ -16,7 +16,7 @@ public class DriveController(
|
|||
[SuppressMessage("ReSharper", "SuggestBaseTypeForParameterInConstructor")]
|
||||
IOptionsSnapshot<Config.StorageSection> options,
|
||||
ILogger<DriveController> logger
|
||||
) : Controller
|
||||
) : ControllerBase
|
||||
{
|
||||
[EnableCors("drive")]
|
||||
[HttpGet("/files/{accessKey}")]
|
||||
|
|
|
@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Mvc;
|
|||
namespace Iceshrimp.Backend.Controllers;
|
||||
|
||||
[Produces(MediaTypeNames.Application.Json)]
|
||||
public class FallbackController : Controller
|
||||
public class FallbackController : ControllerBase
|
||||
{
|
||||
[ProducesResponseType(StatusCodes.Status501NotImplemented, Type = typeof(ErrorResponse))]
|
||||
public IActionResult FallbackAction()
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Iceshrimp.Backend.Controllers;
|
|||
[Route("/identicon/{id}")]
|
||||
[Produces(MediaTypeNames.Image.Png)]
|
||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(object))]
|
||||
public class IdenticonController : Controller
|
||||
public class IdenticonController : ControllerBase
|
||||
{
|
||||
[HttpGet]
|
||||
public async Task GetIdenticon(string id)
|
||||
|
|
|
@ -30,7 +30,7 @@ public class AccountController(
|
|||
NotificationService notificationSvc,
|
||||
ActivityPub.ActivityRenderer activityRenderer,
|
||||
ActivityPub.ActivityDeliverService deliverSvc
|
||||
) : Controller
|
||||
) : ControllerBase
|
||||
{
|
||||
[HttpGet("verify_credentials")]
|
||||
[Authorize("read:accounts")]
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace Iceshrimp.Backend.Controllers.Mastodon;
|
|||
[EnableRateLimiting("sliding")]
|
||||
[EnableCors("mastodon")]
|
||||
[Produces(MediaTypeNames.Application.Json)]
|
||||
public class AuthController(DatabaseContext db) : Controller
|
||||
public class AuthController(DatabaseContext db) : ControllerBase
|
||||
{
|
||||
[HttpGet("/api/v1/apps/verify_credentials")]
|
||||
[Authenticate]
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Iceshrimp.Backend.Controllers.Mastodon;
|
|||
[EnableCors("mastodon")]
|
||||
[EnableRateLimiting("sliding")]
|
||||
[Produces(MediaTypeNames.Application.Json)]
|
||||
public class InstanceController(DatabaseContext db) : Controller
|
||||
public class InstanceController(DatabaseContext db) : ControllerBase
|
||||
{
|
||||
[HttpGet("/api/v1/instance")]
|
||||
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.Status401Unauthorized, 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/v2/media")]
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace Iceshrimp.Backend.Controllers.Mastodon;
|
|||
[EnableCors("mastodon")]
|
||||
[EnableRateLimiting("sliding")]
|
||||
[Produces(MediaTypeNames.Application.Json)]
|
||||
public class NotificationController(DatabaseContext db, NotificationRenderer notificationRenderer) : Controller
|
||||
public class NotificationController(DatabaseContext db, NotificationRenderer notificationRenderer) : ControllerBase
|
||||
{
|
||||
[HttpGet]
|
||||
[Authorize("read:notifications")]
|
||||
|
|
|
@ -28,7 +28,7 @@ public class SearchController(
|
|||
UserRenderer userRenderer,
|
||||
NoteService noteSvc,
|
||||
ActivityPub.UserResolver userResolver
|
||||
) : Controller
|
||||
) : ControllerBase
|
||||
{
|
||||
[HttpGet("/api/v2/search")]
|
||||
[Authorize("read:search")]
|
||||
|
|
|
@ -26,7 +26,7 @@ public class StatusController(
|
|||
NoteRenderer noteRenderer,
|
||||
NoteService noteSvc,
|
||||
IDistributedCache cache
|
||||
) : Controller
|
||||
) : ControllerBase
|
||||
{
|
||||
[HttpGet("{id}")]
|
||||
[Authenticate("read:statuses")]
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace Iceshrimp.Backend.Controllers.Mastodon;
|
|||
[Produces(MediaTypeNames.Application.Json)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized, 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")]
|
||||
[HttpGet("home")]
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Iceshrimp.Backend.Controllers;
|
|||
[Route("/nodeinfo")]
|
||||
[EnableCors("well-known")]
|
||||
[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.0")]
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Iceshrimp.Backend.Controllers;
|
|||
[EnableRateLimiting("sliding")]
|
||||
[Route("/api/iceshrimp/v1/note")]
|
||||
[Produces(MediaTypeNames.Application.Json)]
|
||||
public class NoteController(DatabaseContext db, NoteService noteSvc) : Controller
|
||||
public class NoteController(DatabaseContext db, NoteService noteSvc) : ControllerBase
|
||||
{
|
||||
[HttpGet("{id}")]
|
||||
[Authenticate]
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Iceshrimp.Backend.Controllers;
|
|||
[EnableRateLimiting("sliding")]
|
||||
[Route("/api/iceshrimp/v1/timeline")]
|
||||
[Produces(MediaTypeNames.Application.Json)]
|
||||
public class TimelineController(DatabaseContext db, IDistributedCache cache) : Controller
|
||||
public class TimelineController(DatabaseContext db, IDistributedCache cache) : ControllerBase
|
||||
{
|
||||
[HttpGet("home")]
|
||||
[Authenticate]
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Iceshrimp.Backend.Controllers;
|
|||
[EnableRateLimiting("sliding")]
|
||||
[Route("/api/iceshrimp/v1/user/{id}")]
|
||||
[Produces(MediaTypeNames.Application.Json)]
|
||||
public class UserController(DatabaseContext db) : Controller
|
||||
public class UserController(DatabaseContext db) : ControllerBase
|
||||
{
|
||||
[HttpGet]
|
||||
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(UserResponse))]
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Iceshrimp.Backend.Controllers;
|
|||
[Tags("Federation")]
|
||||
[Route("/.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")]
|
||||
[Produces(MediaTypeNames.Application.Json)]
|
||||
|
|
Loading…
Add table
Reference in a new issue