QueryExpenseItemCategoryController.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. using Microsoft.AspNetCore.Mvc;
  2. using SMP.Model;
  3. using SMP.Model.Compute;
  4. using SMP.Service;
  5. using SMP.Service.Compute;
  6. using XYY.Common.Standard;
  7. namespace SMP.Api.Base.Controllers
  8. {
  9. [ApiController]
  10. [Route("[controller]")]
  11. public class QueryExpenseItemCategoryController : ControllerBase
  12. {
  13. public QueryExpenseItemCategoryController(IComputeExpenseItemCategoryService ExpenseCategoryService)
  14. {
  15. this.ExpenseCategoryService = ExpenseCategoryService;
  16. }
  17. public IComputeExpenseItemCategoryService ExpenseCategoryService { get; }
  18. [HttpPost]
  19. public async Task<PageResult<Compute_ExpenseItemCategory>> Post([FromBody] QueryModel model)
  20. {
  21. return await ExpenseCategoryService.QueryExpenseItemCategory(model);
  22. }
  23. [HttpGet]
  24. public async Task<IEnumerable<Compute_ExpenseItemCategory>> Get()
  25. {
  26. return (await ExpenseCategoryService.GetAllExpenseItemCategory()).OrderBy(x => x.Name).ToList();
  27. }
  28. }
  29. }