| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- namespace App\Module\Pet\Events;
- use Illuminate\Broadcasting\InteractsWithSockets;
- use Illuminate\Foundation\Events\Dispatchable;
- use Illuminate\Queue\SerializesModels;
- /**
- * 宠物洗髓事件
- *
- * 当宠物进行洗髓操作时触发此事件,允许其他系统响应宠物品阶的变化。
- * 此事件可用于更新宠物属性、记录洗髓日志、处理品阶变化效果等。
- */
- class PetRemouldEvent
- {
- use Dispatchable, InteractsWithSockets, SerializesModels;
- /**
- * 用户ID
- *
- * @var int
- */
- public int $userId;
- /**
- * 宠物ID
- *
- * @var int
- */
- public int $petId;
- /**
- * 旧品阶
- *
- * @var int
- */
- public int $oldGrade;
- /**
- * 新品阶
- *
- * @var int
- */
- public int $newGrade;
- /**
- * 创建一个新的事件实例
- *
- * @param int $userId 用户ID
- * @param int $petId 宠物ID
- * @param int $oldGrade 旧品阶
- * @param int $newGrade 新品阶
- * @return void
- */
- public function __construct(int $userId, int $petId, int $oldGrade, int $newGrade)
- {
- $this->userId = $userId;
- $this->petId = $petId;
- $this->oldGrade = $oldGrade;
- $this->newGrade = $newGrade;
- }
- }
|