<?php
/**
 *
 * @date 2022-4-1
 * @author JZW
 **/
namespace Test\Friend;

use Framework\Lib\Utils;
use Framework\MVC\ModelManager;
use Game\Config\GameConfig;
use Game\Constant\DBTableDefine;
use Game\Constant\ModelTypeDefine;
use Game\Data\Friends\FriendIntimacyApplyData;
use Game\Data\Friends\FriendIntimacyData;
use Game\Logic\Friend\FriendLogic;
use Game\Logic\NoticeLogic;
use Game\Model\Friend\FriendModel;
use Test\TestBase;

class TestFriend  extends TestBase
{
    use FriendLogic;
    use NoticeLogic;

    public function getPlayerId(): int
    {
        return 288872376657689669;    //发申请人
//        return 288877577863085164;      //接收人
    }

    public function startTest()
    {
//        $ret = array();
//        $this->apply(288409533771844100, $ret);
//        $this->agree(288415843078801356);
//        $this->getMineList(1, $ret);
//        $this->remark(288381955786404149, "wozhishiguang", $code);
//        $this->getPreciseSearchList("wozhishiguang", $code);
//        $this->good(288381955786404149, $code);
//        $this->syncFriendStatusToAll(3);
        //测试亲密度
//        $this->addFriendIntimacy(288877577863085164, 10, 1);

        //重置信息
//        $this->resetFriendIntimacyData();

//        $data = new FriendIntimacyData($this->getPlayerId(), 288877577863085164);
//        var_dump($data->getIntimacyNum());
//        var_dump($data->getAllIntimacy());

//        $data = new FriendIntimacyApplyData(123, $this->getPlayerId(), 222);
//        $data->createApply();
//        var_dump($data->searchExpireApply(time() + 24*3600));
//        $data->delApply(123);
//        echo  $this->applyIntimacy($this->getPlayerId(), 288877577863085164, 1001);
//        var_dump($this->getMyIntimacyApplyInfo());
//        echo $this->intimacyApplyOption(1441814677496856808, true);
//        var_dump($this->dealExpireApply());
//        $code = 0;
//        echo $this->removeIntimacyTitle($this->getPlayerId(), 288872376657689669, $code);
        /**
         * @var FriendModel $friend
         */
        $friend = ModelManager::getInstance()->getModel(ModelTypeDefine::FRIEND);
        $friend->setRespondentPlayerId(288877577863085164);
        $friendData = $friend->getFriendData();
        var_dump($friendData);
    }
}