Update to latest packages and show examples
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
using Asp.Versioning;
|
||||
using GerstITS.Authentication.ApiKey;
|
||||
using GerstITS.Examples.Api.Versioning;
|
||||
using GerstITS.System.Environment;
|
||||
using GerstITS.Validation;
|
||||
using GerstITS.Web.Api;
|
||||
using GerstITS.Web.Api.FluentApi;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace GerstITS.Examples.Api.Controllers._1._1;
|
||||
|
||||
/// <summary>
|
||||
/// Is responsible to provide maintenance functions protected by an api key header.
|
||||
/// </summary>
|
||||
[ApiController,
|
||||
ApiVersion(Versions._1_1),
|
||||
ApiKey,
|
||||
Route(ApplicationEnvironment.WebApi.ControllerRouteTemplate)]
|
||||
public class MaintenanceController : FluentApiControllerBase
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private readonly ISystemClock _systemClock;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public MaintenanceController(ISystemClock systemClock,
|
||||
IValidator validator)
|
||||
: base(validator)
|
||||
{
|
||||
_systemClock = systemClock;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current server time. Requires a valid api key header.
|
||||
/// </summary>
|
||||
/// <returns>Returns the current server time.</returns>
|
||||
[HttpGet,
|
||||
Route("Ping")]
|
||||
public IActionResult Ping()
|
||||
{
|
||||
return Api().Get(() => _systemClock.UtcNow);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user