HouseDowngradedEvent.php 969 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace App\Module\Farm\Events;
  3. use Illuminate\Broadcasting\InteractsWithSockets;
  4. use Illuminate\Foundation\Events\Dispatchable;
  5. use Illuminate\Queue\SerializesModels;
  6. /**
  7. * 房屋降级事件
  8. *
  9. * 当房屋等级降低时触发此事件
  10. */
  11. class HouseDowngradedEvent
  12. {
  13. use Dispatchable, InteractsWithSockets, SerializesModels;
  14. /**
  15. * 用户ID
  16. *
  17. * @var int
  18. */
  19. public $userId;
  20. /**
  21. * 旧等级
  22. *
  23. * @var int
  24. */
  25. public $oldLevel;
  26. /**
  27. * 新等级
  28. *
  29. * @var int
  30. */
  31. public $newLevel;
  32. /**
  33. * 创建一个新的事件实例
  34. *
  35. * @param int $userId 用户ID
  36. * @param int $oldLevel 旧等级
  37. * @param int $newLevel 新等级
  38. * @return void
  39. */
  40. public function __construct(int $userId, int $oldLevel, int $newLevel)
  41. {
  42. $this->userId = $userId;
  43. $this->oldLevel = $oldLevel;
  44. $this->newLevel = $newLevel;
  45. }
  46. }