Files
mixtape/zero.Backoffice/_legacy/Controllers/MediaFolderController.cs
T

27 lines
968 B
C#
Raw Normal View History

2020-05-18 11:53:23 +02:00
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
2020-05-18 11:53:23 +02:00
using System.Threading.Tasks;
2021-11-19 13:31:54 +01:00
using zero.Core.Collections;
2020-05-18 11:53:23 +02:00
using zero.Core.Entities;
using zero.Core.Identity;
using zero.Web.Models;
2020-05-18 11:53:23 +02:00
namespace zero.Web.Controllers
{
[ZeroAuthorize(Permissions.Sections.Media, PermissionsValue.True)]
2021-11-19 13:31:54 +01:00
public class MediaFolderController : ZeroBackofficeCollectionController<MediaFolder, IMediaFolderCollection>
2020-05-18 11:53:23 +02:00
{
2021-11-19 13:31:54 +01:00
public MediaFolderController(IMediaFolderCollection collection) : base(collection) { }
2020-05-18 11:53:23 +02:00
2021-11-19 13:31:54 +01:00
public async Task<IList<MediaFolder>> GetHierarchy([FromQuery] string id) => await Collection.GetHierarchy(id);
2020-05-18 11:53:23 +02:00
2021-11-19 13:31:54 +01:00
public async Task<IList<TreeItem>> GetAllAsTree([FromQuery] string parent = null, [FromQuery] string active = null) => await Collection.LoadAsTree(parent, active);
2020-05-18 11:53:23 +02:00
[HttpPost]
2021-11-19 13:31:54 +01:00
public async Task<EntityResult<MediaFolder>> Move([FromBody] ActionCopyModel model) => await Collection.Move(model.Id, model.DestinationId);
2020-05-18 11:53:23 +02:00
}
}