Open Source Web Application Framework for ASP.NET Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

43 lines
1.2 KiB

using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Content;
using Volo.Blogging.Files;
namespace Volo.Blogging
{
[RemoteService(Name = BloggingRemoteServiceConsts.RemoteServiceName)]
[Area(BloggingRemoteServiceConsts.ModuleName)]
[Route("api/blogging/files")]
public class BlogFilesController : AbpControllerBase, IFileAppService
{
private readonly IFileAppService _fileAppService;
public BlogFilesController(IFileAppService fileAppService)
{
_fileAppService = fileAppService;
}
[HttpGet]
[Route("{name}")]
public Task<RawFileDto> GetAsync(string name) //TODO: output cache would be good
{
return _fileAppService.GetAsync(name);
}
[HttpGet]
[Route("www/{name}")]
public virtual async Task<IRemoteStreamContent> GetFileAsync(string name)
{
return await _fileAppService.GetFileAsync(name);
}
[HttpPost]
[Route("images/upload")]
public Task<FileUploadOutputDto> CreateAsync(FileUploadInputDto input)
{
return _fileAppService.CreateAsync(input);
}
}
}