OrderController.cs 856 B

12345678910111213141516171819202122232425262728293031323334
  1. using Bowin.Common.WebModels;
  2. using Microsoft.AspNetCore.Authorization;
  3. using Microsoft.AspNetCore.Mvc;
  4. using OrderSystem.Services;
  5. using System;
  6. namespace OrderSystem.Web.Controllers
  7. {
  8. [Route("api/[controller]/[action]")]
  9. [ApiController]
  10. [Authorize]
  11. public class OrderController : ControllerBase
  12. {
  13. private IOrderService OrderService { get; set; }
  14. public OrderController(IOrderService orderService)
  15. {
  16. OrderService = orderService;
  17. }
  18. [HttpGet]
  19. public ResultMessage GetContractList(string userID)
  20. {
  21. try
  22. {
  23. return ResultMessage.Success(OrderService.GetContractList(userID));
  24. }
  25. catch (Exception ex)
  26. {
  27. return ResultMessage.GetError(ex.Message);
  28. }
  29. }
  30. }
  31. }