<?php

namespace App\Core;

use App\Models\Account\Account;

/**
 * Application/Account/Config 全局代理
 */
class Dipper
{
    /**
     * 账号实例
     *
     * @var Account
     */
    public $account;

    /**
     * 配置实例
     *
     * @var array
     */
    public $config;

    /**
     * 初始化后端用户
     *
     * @param string $key
     * @param boolean $force
     * @return Account
     */
    public function initAccount()
    {
        if ($this->account) {
            return $this->account;
        }

        return app('auth:admin')->authenticate();
    }

    /**
     * 获取站点配置
     *
     * @return array
     */
    public function getConfig($key = null)
    {
    }

    /**
     * 设置站点配置
     *
     * @param string $key;
     * @param string|array $value;
     *
     * @return boolean
     */
    public function setConfig($key, $value)
    {
    }

    /**
     * Set 账号实例
     *
     * @param  Account  $account  账号实例
     *
     * @return  self
     */
    public function setAccount(Account $account)
    {
        $this->account = $account;

        return $this;
    }
}
