ProtobufResponseEvent.php 870 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace App\Module\AppGame\Events;
  3. use Illuminate\Broadcasting\InteractsWithSockets;
  4. use Illuminate\Foundation\Events\Dispatchable;
  5. use Illuminate\Queue\SerializesModels;
  6. use Uraus\Kku\Response;
  7. /**
  8. * Protobuf响应事件
  9. *
  10. * 当Protobuf响应返回前触发此事件,允许其他系统在响应返回前进行处理或修改。
  11. * 此事件可用于记录响应日志、修改响应内容、添加额外数据等操作。
  12. */
  13. class ProtobufResponseEvent
  14. {
  15. use Dispatchable, InteractsWithSockets, SerializesModels;
  16. /**
  17. * 响应对象
  18. *
  19. * @var Response
  20. */
  21. public Response $response;
  22. /**
  23. * 创建一个新的事件实例
  24. *
  25. * @param Response $response Protobuf响应对象
  26. * @return void
  27. */
  28. public function __construct(Response $response)
  29. {
  30. $this->response = $response;
  31. }
  32. }