| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?php
- namespace App\Module\Farm\Events;
- use App\Module\Farm\Models\FarmUpgradeLog;
- use App\Module\Farm\Models\FarmUser;
- use Illuminate\Broadcasting\InteractsWithSockets;
- use Illuminate\Foundation\Events\Dispatchable;
- use Illuminate\Queue\SerializesModels;
- /**
- * 房屋升级事件
- *
- * 当用户升级房屋时触发
- */
- class HouseUpgradedEvent
- {
- use Dispatchable, InteractsWithSockets, SerializesModels;
- /**
- * 用户ID
- *
- * @var int
- */
- public $userId;
- /**
- * 农场信息
- *
- * @var FarmUser
- */
- public $farmUser;
- /**
- * 旧等级
- *
- * @var int
- */
- public $oldLevel;
- /**
- * 新等级
- *
- * @var int
- */
- public $newLevel;
- /**
- * 升级记录
- *
- * @var FarmUpgradeLog
- */
- public $upgradeLog;
- /**
- * 创建一个新的事件实例
- *
- * @param int $userId
- * @param FarmUser $farmUser
- * @param int $oldLevel
- * @param int $newLevel
- * @param FarmUpgradeLog $upgradeLog
- * @return void
- */
- public function __construct(
- int $userId,
- FarmUser $farmUser,
- int $oldLevel,
- int $newLevel,
- FarmUpgradeLog $upgradeLog
- ) {
- $this->userId = $userId;
- $this->farmUser = $farmUser;
- $this->oldLevel = $oldLevel;
- $this->newLevel = $newLevel;
- $this->upgradeLog = $upgradeLog;
- }
- }
|