2020-05-18 11:53:23 +02:00
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2020-10-27 15:47:23 +01:00
|
|
|
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;
|
2020-09-03 14:50:41 +02:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2020-09-03 14:50:41 +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
|
|
|
}
|
|
|
|
|
}
|