<?php

namespace app\admin\controller;


use crmeb\services\async\LuckyCalc;
use crmeb\services\async\ClearanceCalc;
use crmeb\utils\Redis;
use think\facade\Log;
use app\api\controller\board\UserBoardController;
use app\models\redis\SystemCarousel;

class Test
{
    public function index()
    {

        $redis = Redis::instance();
        var_dump($redis->get(['CRMEB','TESD']));
    }

    protected function test_board() {
        Log::warning("board updated.");
        $ctl = new UserBoardController();
        $ctl->cache_board();
    }

    protected function test_calc() {
        $activities = [new ClearanceCalc(), new LuckyCalc()];
        foreach($activities as $activity) {
            $activity->calc();
        }
    }

    protected function test_carousel() {
        SystemCarousel::add('good test', '/pages/leader_board/index');
        print_r(SystemCarousel::getFirst(20));
        SystemCarousel::removeTrash();
    }

    public function test()
    {
        $this->test_carousel();
    }
}