2021-11-29 18:25:50 +01:00
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
2021-12-12 15:41:51 +01:00
|
|
|
namespace zero.Api.Abstractions;
|
2021-11-29 18:25:50 +01:00
|
|
|
|
|
|
|
|
[ApiController]
|
|
|
|
|
[ZeroAuthorize]
|
2021-12-13 16:11:52 +01:00
|
|
|
[ApiMetadataFilter]
|
|
|
|
|
[ApiResponseFilter]
|
2021-12-14 01:23:03 +01:00
|
|
|
[TypeFilter(typeof(ApiExceptionFilter))]
|
|
|
|
|
//[MiddlewareFilter(typeof(ApiUnhandledExceptionMiddlewareFilter))]
|
2021-11-29 18:25:50 +01:00
|
|
|
//[ServiceFilter(typeof(ModelStateValidationFilterAttribute))]
|
|
|
|
|
//[ServiceFilter(typeof(BackofficeFilterAttribute))]
|
|
|
|
|
public abstract class ZeroApiController : ControllerBase
|
|
|
|
|
{
|
|
|
|
|
IZeroMapper _mapper;
|
|
|
|
|
protected IZeroMapper Mapper => _mapper ?? (_mapper = HttpContext?.RequestServices?.GetService<IZeroMapper>());
|
|
|
|
|
|
|
|
|
|
|
2021-12-29 15:29:33 +01:00
|
|
|
public ApiRequestHints Hints { get; protected set; } = new();
|
2021-11-29 18:25:50 +01:00
|
|
|
}
|