* Restore backward compatibility for file system based tree controllers. * Aligned obsoletion messages.
44 lines
1.7 KiB
C#
44 lines
1.7 KiB
C#
using Asp.Versioning;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
|
|
using Umbraco.Cms.Api.Management.Services.FileSystem;
|
|
using Umbraco.Cms.Api.Management.ViewModels.Tree;
|
|
using Umbraco.Cms.Core.IO;
|
|
|
|
namespace Umbraco.Cms.Api.Management.Controllers.Stylesheet.Tree;
|
|
|
|
[ApiVersion("1.0")]
|
|
public class ChildrenStylesheetTreeController : StylesheetTreeControllerBase
|
|
{
|
|
// TODO Remove the static service provider, and replace with base when the other constructors are obsoleted.
|
|
[ActivatorUtilitiesConstructor]
|
|
public ChildrenStylesheetTreeController(IStyleSheetTreeService styleSheetTreeService)
|
|
: base(styleSheetTreeService)
|
|
{
|
|
}
|
|
|
|
[Obsolete("Please use the constructor taking all parameters. Scheduled to be removed in Umbraco 19.")]
|
|
public ChildrenStylesheetTreeController(IStyleSheetTreeService styleSheetTreeService, FileSystems fileSystems)
|
|
: base(styleSheetTreeService, fileSystems)
|
|
{
|
|
}
|
|
|
|
[Obsolete("Please use the constructor taking all parameters. Scheduled to be removed in Umbraco 19.")]
|
|
public ChildrenStylesheetTreeController(FileSystems fileSystems)
|
|
: base(fileSystems)
|
|
{
|
|
}
|
|
|
|
[HttpGet("children")]
|
|
[MapToApiVersion("1.0")]
|
|
[ProducesResponseType(typeof(PagedViewModel<FileSystemTreeItemPresentationModel>), StatusCodes.Status200OK)]
|
|
public async Task<ActionResult<PagedViewModel<FileSystemTreeItemPresentationModel>>> Children(
|
|
CancellationToken cancellationToken,
|
|
string parentPath,
|
|
int skip = 0,
|
|
int take = 100)
|
|
=> await GetChildren(parentPath, skip, take);
|
|
}
|