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.
50 lines
1.2 KiB
50 lines
1.2 KiB
using BookStore.Services; |
|
using BookStore.Services.Dtos; |
|
using Microsoft.AspNetCore.Mvc; |
|
using System; |
|
using System.Threading.Tasks; |
|
using Volo.Abp.Application.Dtos; |
|
using Volo.Abp.AspNetCore.Mvc; |
|
|
|
namespace BookStore.Controllers; |
|
|
|
[Route("api/books")] |
|
public class BookController: AbpController, IBookAppService |
|
{ |
|
private readonly IBookAppService _bookAppService; |
|
|
|
public BookController(IBookAppService bookAppService) |
|
{ |
|
_bookAppService = bookAppService; |
|
} |
|
|
|
[HttpPost] |
|
public Task<BookDto> CreateAsync(BookCreateUpdateInput input) |
|
{ |
|
return _bookAppService.CreateAsync(input); |
|
} |
|
|
|
[HttpDelete("{id}")] |
|
public Task DeleteAsync(Guid id) |
|
{ |
|
return _bookAppService.DeleteAsync(id); |
|
} |
|
|
|
[HttpGet("{id}")] |
|
public Task<BookDto> GetAsync(Guid id) |
|
{ |
|
return _bookAppService.GetAsync(id); |
|
} |
|
|
|
[HttpGet] |
|
public Task<PagedResultDto<BookDto>> GetListAsync(PagedAndSortedResultRequestDto input) |
|
{ |
|
return _bookAppService.GetListAsync(input); |
|
} |
|
|
|
[HttpPut("{id}")] |
|
public Task<BookDto> UpdateAsync(Guid id, BookCreateUpdateInput input) |
|
{ |
|
return _bookAppService.UpdateAsync(id, input); |
|
} |
|
}
|
|
|