stuff
This commit is contained in:
parent
14fd359ea8
commit
a4ef2b4a20
26 changed files with 331 additions and 78 deletions
|
@ -4,6 +4,7 @@ using Femto.Modules.Media.Contracts;
|
|||
using Femto.Modules.Media.Contracts.LoadFile;
|
||||
using Femto.Modules.Media.Contracts.SaveFile;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Femto.Api.Controllers.Media;
|
||||
|
@ -13,6 +14,7 @@ namespace Femto.Api.Controllers.Media;
|
|||
public class MediaController(IMediaModule mediaModule) : ControllerBase
|
||||
{
|
||||
[HttpPost]
|
||||
[Authorize]
|
||||
public async Task<ActionResult<UploadMediaResponse>> UploadMedia(
|
||||
IFormFile file,
|
||||
CancellationToken cancellationToken
|
||||
|
@ -29,6 +31,7 @@ public class MediaController(IMediaModule mediaModule) : ControllerBase
|
|||
}
|
||||
|
||||
[HttpGet("{id}")]
|
||||
[Authorize]
|
||||
public async Task GetMedia(Guid id, CancellationToken cancellationToken)
|
||||
{
|
||||
var res = await mediaModule.PostQuery(new LoadFileQuery(id), cancellationToken);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue