Files
Umbraco-CMS/src/Umbraco.Web.BackOffice/Controllers/PublishedStatusController.cs

28 lines
914 B
C#
Raw Normal View History

2017-10-31 12:48:24 +01:00
using System;
using Microsoft.AspNetCore.Mvc;
2017-10-31 12:48:24 +01:00
using Umbraco.Web.PublishedCache;
namespace Umbraco.Web.BackOffice.Controllers
2017-10-31 12:48:24 +01:00
{
public class PublishedStatusController : UmbracoAuthorizedApiController
{
private readonly IPublishedSnapshotService _publishedSnapshotService;
public PublishedStatusController(IPublishedSnapshotService publishedSnapshotService)
{
_publishedSnapshotService = publishedSnapshotService ?? throw new ArgumentNullException(nameof(publishedSnapshotService));
}
[HttpGet]
public string GetPublishedStatusUrl()
{
if (!string.IsNullOrWhiteSpace(_publishedSnapshotService.StatusUrl))
{
return _publishedSnapshotService.StatusUrl;
}
2017-10-31 12:48:24 +01:00
throw new NotSupportedException("Not supported: " + _publishedSnapshotService.GetType().FullName);
2017-10-31 12:48:24 +01:00
}
}
}