ReceiveMsgController.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. 
  2. using Microsoft.AspNetCore.Mvc;
  3. using Microsoft.Extensions.Caching.Redis;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Threading.Tasks;
  7. using XYY.Authentication.Standard;
  8. using XYY.Core.Standard.Mvc;
  9. using XYY.Service.Standard.First.ESB;
  10. namespace XYY.Api.First.Controllers
  11. {
  12. [Route("api/[controller]/[action]")]
  13. [ApiController]
  14. public class ReceiveMsgController : ControllerBase
  15. {
  16. IESBService _ESBService;
  17. public ReceiveMsgController(IESBService eSBService)
  18. {
  19. _ESBService = eSBService;
  20. }
  21. [HttpPost]
  22. public async Task<ApiJsonModel> Update(Dto dto)
  23. {
  24. _ESBService.TestTask(dto);
  25. return ApiJsonModel.OK();
  26. }
  27. [HttpPost]
  28. public async Task<ApiJsonModel> Updates(Dto2 dtos)
  29. {
  30. await _ESBService.TestTask(dtos);
  31. return ApiJsonModel.OK();
  32. }
  33. [HttpGet]
  34. public async Task<ApiJsonModel> Get(string TrackingNumber)
  35. {
  36. var data = _ESBService.Reader(TrackingNumber);
  37. return ApiJsonModel.OK(data);
  38. }
  39. }
  40. }