chore: init commit from GitHub
This commit is contained in:
22
SWAD.API/Controllers/ProblemsController.cs
Normal file
22
SWAD.API/Controllers/ProblemsController.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace SWAD.API.Controllers;
|
||||
|
||||
public abstract class ProblemsController : ControllerBase
|
||||
{
|
||||
protected ObjectResult BadRequest(string? detail)
|
||||
{
|
||||
return Problem(statusCode: StatusCodes.Status400BadRequest, title: "Bad request!", detail: detail);
|
||||
}
|
||||
|
||||
protected ObjectResult NotFound(string? detail)
|
||||
{
|
||||
return Problem(statusCode: StatusCodes.Status404NotFound, title: "Not found :c", detail: detail);
|
||||
}
|
||||
|
||||
protected ObjectResult BadGateway(string? detail)
|
||||
{
|
||||
return Problem(statusCode: StatusCodes.Status502BadGateway, title: "Some problems in other side, dude!",
|
||||
detail: detail);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user