mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-06-25 13:59:15 +08:00
62 lines
1.5 KiB
PHP
62 lines
1.5 KiB
PHP
<?php
|
||
|
||
// +----------------------------------------------------------------------
|
||
// | ThinkAdmin
|
||
// +----------------------------------------------------------------------
|
||
// | 版权所有 2014~2020 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
|
||
// +----------------------------------------------------------------------
|
||
// | 官方网站: https://gitee.com/zoujingli/ThinkLibrary
|
||
// +----------------------------------------------------------------------
|
||
// | 开源协议 ( https://mit-license.org )
|
||
// +----------------------------------------------------------------------
|
||
// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkLibrary
|
||
// | github 代码仓库:https://github.com/zoujingli/ThinkLibrary
|
||
// +----------------------------------------------------------------------
|
||
|
||
namespace think\admin;
|
||
|
||
use think\App;
|
||
use think\Container;
|
||
|
||
/**
|
||
* 自定义服务基类
|
||
* Class Service
|
||
* @package think\admin
|
||
*/
|
||
abstract class Service
|
||
{
|
||
/**
|
||
* 应用实例
|
||
* @var App
|
||
*/
|
||
protected $app;
|
||
|
||
/**
|
||
* Service constructor.
|
||
* @param App $app
|
||
*/
|
||
public function __construct(App $app)
|
||
{
|
||
$this->app = $app;
|
||
$this->initialize();
|
||
}
|
||
|
||
/**
|
||
* 初始化服务
|
||
* @return $this
|
||
*/
|
||
protected function initialize()
|
||
{
|
||
return $this;
|
||
}
|
||
|
||
/**
|
||
* 静态实例对象
|
||
* @param array $args
|
||
* @return static
|
||
*/
|
||
public static function instance(...$args)
|
||
{
|
||
return Container::getInstance()->make(static::class, $args);
|
||
}
|
||
} |