FundChangedEvent.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <?php
  2. namespace App\Module\Fund\Events;
  3. use App\Module\Fund\Models\FundAccount;
  4. use Illuminate\Broadcasting\InteractsWithSockets;
  5. use Illuminate\Foundation\Events\Dispatchable;
  6. use Illuminate\Queue\SerializesModels;
  7. /**
  8. * 资金变更事件
  9. */
  10. class FundChangedEvent
  11. {
  12. use Dispatchable, InteractsWithSockets, SerializesModels;
  13. /**
  14. * 用户ID
  15. *
  16. * @var int
  17. */
  18. public int $userId;
  19. /**
  20. * 资金账户ID
  21. *
  22. * @var int
  23. */
  24. public int $fundId;
  25. /**
  26. * 变更金额(毫)
  27. *
  28. * @var int
  29. */
  30. public int $amount;
  31. /**
  32. * 变更前余额(毫)
  33. *
  34. * @var int
  35. */
  36. public int $beforeBalance;
  37. /**
  38. * 变更后余额(毫)
  39. *
  40. * @var int
  41. */
  42. public int $afterBalance;
  43. /**
  44. * 操作类型
  45. *
  46. * @var int
  47. */
  48. public int $operateType;
  49. /**
  50. * 操作ID
  51. *
  52. * @var int|string
  53. */
  54. public $operateId;
  55. /**
  56. * 备注
  57. *
  58. * @var string
  59. */
  60. public string $remark;
  61. /**
  62. * 创建一个新的事件实例
  63. *
  64. * @param int $userId 用户ID
  65. * @param int $fundId 资金账户ID
  66. * @param int $amount 变更金额(毫)
  67. * @param int $beforeBalance 变更前余额(毫)
  68. * @param int $afterBalance 变更后余额(毫)
  69. * @param int $operateType 操作类型
  70. * @param int|string $operateId 操作ID
  71. * @param string $remark 备注
  72. * @return void
  73. */
  74. public function __construct(
  75. int $userId,
  76. int $fundId,
  77. int $amount,
  78. int $beforeBalance,
  79. int $afterBalance,
  80. int $operateType,
  81. $operateId,
  82. string $remark
  83. ) {
  84. $this->userId = $userId;
  85. $this->fundId = $fundId;
  86. $this->amount = $amount;
  87. $this->beforeBalance = $beforeBalance;
  88. $this->afterBalance = $afterBalance;
  89. $this->operateType = $operateType;
  90. $this->operateId = $operateId;
  91. $this->remark = $remark;
  92. }
  93. }