ExternalAndGroupOperateEvent.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php
  2. namespace App\Events;
  3. use Illuminate\Broadcasting\Channel;
  4. use Illuminate\Broadcasting\InteractsWithSockets;
  5. use Illuminate\Broadcasting\PrivateChannel;
  6. use Illuminate\Foundation\Events\Dispatchable;
  7. use Illuminate\Queue\SerializesModels;
  8. //外部人员群操作事件进群,退群
  9. class ExternalAndGroupOperateEvent
  10. {
  11. use Dispatchable, InteractsWithSockets, SerializesModels;
  12. /*
  13. * 企微ID
  14. */
  15. public $corpId;
  16. /*
  17. * 群ID
  18. */
  19. public $chatId;
  20. /*
  21. * 变更的群成员数组
  22. */
  23. public $memChangeArray;
  24. /*
  25. * 外部联系人ID
  26. */
  27. public $externalUserId;
  28. /*
  29. * 变更类型,当前默认update
  30. */
  31. public $changeType;
  32. /*
  33. * 变更详情类型:1:成员入群、2:成员退群
  34. */
  35. public $updateDetailType;
  36. /*
  37. * 入群时有值,0:成员邀请入群、3:扫描群二维码入群
  38. */
  39. public $joinScene;
  40. /*
  41. * 退群时有值,0:自己退群、1:群主/群管理员移出
  42. */
  43. public $quitScene;
  44. /**
  45. * Create a new event instance.
  46. *
  47. * @param $corpId
  48. * @param $chatId
  49. * @param $memChangeArray
  50. * @param $changeType
  51. * @param $updateDetailType
  52. * @param $joinScene
  53. * @param $quitScene
  54. */
  55. public function __construct($corpId, $chatId, $memChangeArray, $changeType, $updateDetailType, $joinScene, $quitScene)
  56. {
  57. $this->corpId = $corpId;
  58. $this->chatId = $chatId;
  59. $this->memChangeArray = $memChangeArray;
  60. $this->changeType = $changeType;
  61. $this->updateDetailType = $updateDetailType;
  62. $this->joinScene = $joinScene;
  63. $this->quitScene = $quitScene;
  64. }
  65. /**
  66. * Get the channels the event should broadcast on.
  67. *
  68. * @return Channel|array
  69. */
  70. public function broadcastOn()
  71. {
  72. return new PrivateChannel('channel-name');
  73. }
  74. }