oqtane.framework/Oqtane.Server/Controllers/OutputCacheController.cs
2025-03-11 11:48:43 -04:00

31 lines
737 B
C#

using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Oqtane.Models;
using Oqtane.Services;
using Oqtane.Shared;
namespace Oqtane.Controllers
{
[Route(ControllerRoutes.ApiRoute)]
public class OutputCacheController : Controller
{
private readonly IOutputCacheService _cacheService;
public OutputCacheController(IOutputCacheService cacheService)
{
_cacheService = cacheService;
}
// DELETE api/<controller>/{tag}
[HttpDelete("{tag}")]
[Authorize(Roles = RoleNames.Admin)]
public async Task EvictByTag(string tag)
{
await _cacheService.EvictByTag(tag);
}
}
}