123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?php
- namespace App\Listeners;
- use App\Events\EachLike;
- use App\Events\PairSuccess;
- use App\Events\PairTwoSideAgree;
- use App\Events\UnEachLike;
- use App\Managers\FriendManager;
- use App\Models\Friends\FriendContact;
- use App\Models\Friends\FriendModel;
- use App\Models\Friends\LogModel;
- /**
- * 好友列表map变化监听器
- * Class FriendMapChange
- * @package App\Listeners
- */
- class FriendMapChange
- {
- /**
- * Create the event listener.
- *
- * @return void
- */
- public function __construct()
- {
- //
- }
- /**
- * Handle the event.
- *
- * @param object $event
- * @return void
- */
- public function handle($event)
- {
- }
- public function eachLike(EachLike $event)
- {
- $friendManager = new FriendManager();
- $friendManager->beContact($event->uid, $event->isLikeUid);
- $friendContact = new FriendContact();
- $friendContact->setEachLike($event->uid, $event->isLikeUid, 1);
- }
- public function unEachLike(UnEachLike $event)
- {
- $friendContact = new FriendContact();
- $friendContact->setEachLike($event->uid, $event->unLikeUid, 0);
- }
- /**
- * 分配对象活动-匹配成功
- * @param PairSuccess $event
- * @throws \Throwable
- */
- public function pairSuccess(PairSuccess $event)
- {
- $friendManager = new FriendManager();
- $friendManager->beContact($event->uid, $event->pairUid);
- }
- /**
- * 分配对象活动-双方同意
- * @param PairTwoSideAgree $event
- * @throws \Throwable
- */
- public function pairTwoSideAgree(PairTwoSideAgree $event)
- {
- $friendManager = new FriendManager();
- $friendManager->beFriend($event->uid, $event->pairUid);
- }
- }
|