| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace App\Module\Farm\Events;
- use Illuminate\Broadcasting\InteractsWithSockets;
- use Illuminate\Foundation\Events\Dispatchable;
- use Illuminate\Queue\SerializesModels;
- /**
- * 房屋降级事件
- *
- * 当房屋等级降低时触发此事件
- */
- class HouseDowngradedEvent
- {
- use Dispatchable, InteractsWithSockets, SerializesModels;
- /**
- * 用户ID
- *
- * @var int
- */
- public $userId;
- /**
- * 旧等级
- *
- * @var int
- */
- public $oldLevel;
- /**
- * 新等级
- *
- * @var int
- */
- public $newLevel;
- /**
- * 创建一个新的事件实例
- *
- * @param int $userId 用户ID
- * @param int $oldLevel 旧等级
- * @param int $newLevel 新等级
- * @return void
- */
- public function __construct(int $userId, int $oldLevel, int $newLevel)
- {
- $this->userId = $userId;
- $this->oldLevel = $oldLevel;
- $this->newLevel = $newLevel;
- }
- }
|