<?php
declare (strict_types=1);

namespace core\base;

/**
 * API控制器基类
 */
class BaseApiController extends BaseController
{
    protected int $userId = 0;
    protected array $userInfo = [];

    public function initialize(): void
    {
        if (isset($this->request->userInfo) && $this->request->userInfo) {
            $this->userInfo = $this->request->userInfo->toArray();
            $this->userId = $this->request->userId;
        }
    }
}
