42 lines
701 B
PHP
42 lines
701 B
PHP
<?php
|
|
/**
|
|
* This service file is part of item.
|
|
*
|
|
* @author ctexthuang
|
|
* @contact ctexthuang@qq.com
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Service\Admin;
|
|
|
|
use Hyperf\Context\Context;
|
|
|
|
abstract class BaseService
|
|
{
|
|
/**
|
|
* 管理员id
|
|
* @var int $adminId
|
|
*/
|
|
protected int $adminId = 0;
|
|
|
|
/**
|
|
* 角色id
|
|
* @var int $roleId
|
|
*/
|
|
protected int $roleId = 0;
|
|
|
|
/**
|
|
* 主构造函数(获取请求对象)
|
|
*/
|
|
public function __construct()
|
|
{
|
|
$this->adminId = Context::get("admin_id",0);
|
|
$this->roleId = Context::get("role_id",0);
|
|
}
|
|
|
|
/**
|
|
* 主体函数抽象类
|
|
*/
|
|
abstract public function handle();
|
|
} |