add Base Controllers ...
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using xCommons.Attributes;
|
||||
using xCommons.Configurations;
|
||||
using xCommons.Providers;
|
||||
|
||||
namespace xCommons.Controllers {
|
||||
/// <summary>
|
||||
/// Base Api Controller
|
||||
/// </summary>
|
||||
[ApiController]
|
||||
[RequireXPowered(true)]
|
||||
[Route("api/[controller]")]
|
||||
[Produces("application/json")]
|
||||
public abstract partial class XBaseApiController : XBaseController
|
||||
{
|
||||
protected XBaseApiController(
|
||||
ILogger logger,
|
||||
XAppConfiguration appConfiguration,
|
||||
XValidationProvider validationProvider
|
||||
) : base(
|
||||
logger,
|
||||
appConfiguration,
|
||||
validationProvider
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using xCommons.Attributes;
|
||||
using xCommons.Configurations;
|
||||
using xCommons.Extensions;
|
||||
using xCommons.Providers;
|
||||
using xExceptions.Constants;
|
||||
|
||||
namespace xCommons.Controllers {
|
||||
/// <summary>
|
||||
/// Base Api V1 Controller
|
||||
/// </summary>
|
||||
[ApiController]
|
||||
[ApiVersion("1.0")]
|
||||
[RequireXPowered(true)]
|
||||
[Route("api/v{version:apiVersion}/[controller]")]
|
||||
public abstract partial class XBaseApiV1Controller : XBaseApiController
|
||||
{
|
||||
protected XBaseApiV1Controller(
|
||||
ILogger logger,
|
||||
XAppConfiguration appConfiguration,
|
||||
XValidationProvider validationProvider
|
||||
) : base(
|
||||
logger,
|
||||
appConfiguration,
|
||||
validationProvider
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user