BookController.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using Business.BookManagement;
  2. using Business.BookManagement.Dto;
  3. using Microsoft.AspNetCore.Mvc;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Threading.Tasks;
  7. using Volo.Abp;
  8. using Volo.Abp.Application.Dtos;
  9. using Volo.Abp.AspNetCore.Mvc;
  10. namespace Business.Controllers
  11. {
  12. [RemoteService]
  13. [Area("Business")]
  14. [Route("api/business/book")]
  15. public class BookController : AbpController
  16. {
  17. private readonly IBookAppService _BookAppService;
  18. public BookController(IBookAppService BookAppService)
  19. {
  20. _BookAppService = BookAppService;
  21. }
  22. [HttpPost]
  23. [Route("data-post")]
  24. public Task<BookDto> CreateOrUpdate(CreateOrUpdateBookDto input)
  25. {
  26. return _BookAppService.CreateOrUpdate(input);
  27. }
  28. [HttpPost]
  29. [Route("delete")]
  30. public Task Delete(List<Guid> ids)
  31. {
  32. return _BookAppService.Delete(ids);
  33. }
  34. [HttpGet]
  35. [Route("{id}")]
  36. public Task<BookDto> Get(Guid id)
  37. {
  38. return _BookAppService.Get(id);
  39. }
  40. [HttpGet]
  41. public Task<PagedResultDto<BookDto>> GetAll(GetBookInputDto input)
  42. {
  43. return _BookAppService.GetAll(input);
  44. }
  45. }
  46. }