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.

61 lines
1.9 KiB

1 year ago
  1. using Business.Resend;
  2. using Common;
  3. using Common.Model;
  4. using JsonRx.AuthFilter;
  5. using JsonRx.Helper;
  6. using log4net;
  7. using System;
  8. using System.Web.Http;
  9. namespace JsonRx.Api
  10. {
  11. /// <summary>
  12. /// Api endpoints for transaction resend module.
  13. /// </summary>
  14. [RoutePrefix("api/v1/resend")]
  15. public class ResendController : ApiController
  16. {
  17. private IResendBusiness _resendBusiness;
  18. private static readonly ILog Log = LogManager.GetLogger(typeof(ResendController));
  19. /// <summary>
  20. /// </summary>
  21. public ResendController() { }
  22. /// <summary>
  23. /// </summary>
  24. public ResendController(IResendBusiness resendBusiness)
  25. {
  26. _resendBusiness = resendBusiness;
  27. }
  28. /// <summary>
  29. /// </summary>
  30. /// <returns></returns>
  31. [HttpPost]
  32. [TokenAuthentication]
  33. [Route("list")]
  34. public IHttpActionResult GetTransactionResendList(DateFilterParams search)
  35. {
  36. LogicalThreadContext.Properties[LoggerProperty.PROCESSID] = Guid.NewGuid();
  37. LogicalThreadContext.Properties[LoggerProperty.METHODNAME] = "GetTransactionResendList";
  38. var id = Util.GetCustomerId(Request);
  39. JsonRxResponse res = _resendBusiness.GetResendLists(search, id);
  40. return Ok(res);
  41. }
  42. /// <summary>
  43. /// </summary>
  44. /// <returns></returns>
  45. [HttpPost]
  46. [TokenAuthentication]
  47. [Route("detail")]
  48. public IHttpActionResult GetTransactionSummary(DateFilterParams obj)
  49. {
  50. LogicalThreadContext.Properties[LoggerProperty.PROCESSID] = Guid.NewGuid();
  51. LogicalThreadContext.Properties[LoggerProperty.METHODNAME] = "GetTransactionResendList";
  52. JsonRxResponse res = _resendBusiness.GetTransactionSummary(obj.tranId);
  53. return Ok(res);
  54. }
  55. }
  56. }