FundTransferEvent.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <?php
  2. namespace App\Module\Fund\Events;
  3. use Illuminate\Broadcasting\InteractsWithSockets;
  4. use Illuminate\Foundation\Events\Dispatchable;
  5. use Illuminate\Queue\SerializesModels;
  6. /**
  7. * 资金转账事件
  8. */
  9. class FundTransferEvent
  10. {
  11. use Dispatchable, InteractsWithSockets, SerializesModels;
  12. /**
  13. * 转出用户ID
  14. *
  15. * @var int
  16. */
  17. public int $fromUserId;
  18. /**
  19. * 转出资金账户ID
  20. *
  21. * @var int
  22. */
  23. public int $fromFundId;
  24. /**
  25. * 转入用户ID
  26. *
  27. * @var int
  28. */
  29. public int $toUserId;
  30. /**
  31. * 转入资金账户ID
  32. *
  33. * @var int
  34. */
  35. public int $toFundId;
  36. /**
  37. * 转账金额(毫)
  38. *
  39. * @var int
  40. */
  41. public int $amount;
  42. /**
  43. * 转出前余额(毫)
  44. *
  45. * @var int
  46. */
  47. public int $fromBeforeBalance;
  48. /**
  49. * 转出后余额(毫)
  50. *
  51. * @var int
  52. */
  53. public int $fromAfterBalance;
  54. /**
  55. * 转入前余额(毫)
  56. *
  57. * @var int
  58. */
  59. public int $toBeforeBalance;
  60. /**
  61. * 转入后余额(毫)
  62. *
  63. * @var int
  64. */
  65. public int $toAfterBalance;
  66. /**
  67. * 操作类型
  68. *
  69. * @var int
  70. */
  71. public int $operateType;
  72. /**
  73. * 操作ID
  74. *
  75. * @var int
  76. */
  77. public int $operateId;
  78. /**
  79. * 备注
  80. *
  81. * @var string
  82. */
  83. public string $remark;
  84. /**
  85. * 创建一个新的事件实例
  86. *
  87. * @param int $fromUserId 转出用户ID
  88. * @param int $fromFundId 转出资金账户ID
  89. * @param int $toUserId 转入用户ID
  90. * @param int $toFundId 转入资金账户ID
  91. * @param int $amount 转账金额(毫)
  92. * @param int $fromBeforeBalance 转出前余额(毫)
  93. * @param int $fromAfterBalance 转出后余额(毫)
  94. * @param int $toBeforeBalance 转入前余额(毫)
  95. * @param int $toAfterBalance 转入后余额(毫)
  96. * @param int $operateType 操作类型
  97. * @param int $operateId 操作ID
  98. * @param string $remark 备注
  99. * @return void
  100. */
  101. public function __construct(
  102. int $fromUserId,
  103. int $fromFundId,
  104. int $toUserId,
  105. int $toFundId,
  106. int $amount,
  107. int $fromBeforeBalance,
  108. int $fromAfterBalance,
  109. int $toBeforeBalance,
  110. int $toAfterBalance,
  111. int $operateType,
  112. int $operateId,
  113. string $remark
  114. ) {
  115. $this->fromUserId = $fromUserId;
  116. $this->fromFundId = $fromFundId;
  117. $this->toUserId = $toUserId;
  118. $this->toFundId = $toFundId;
  119. $this->amount = $amount;
  120. $this->fromBeforeBalance = $fromBeforeBalance;
  121. $this->fromAfterBalance = $fromAfterBalance;
  122. $this->toBeforeBalance = $toBeforeBalance;
  123. $this->toAfterBalance = $toAfterBalance;
  124. $this->operateType = $operateType;
  125. $this->operateId = $operateId;
  126. $this->remark = $remark;
  127. }
  128. }