feat: command
Some checks are pending
Build Docker / build (push) Waiting to run
Some checks are pending
Build Docker / build (push) Waiting to run
This commit is contained in:
42
app/Service/Admin/BaseService.php
Normal file
42
app/Service/Admin/BaseService.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?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();
|
||||
}
|
||||
22
app/Service/Admin/User/LoginService.php
Normal file
22
app/Service/Admin/User/LoginService.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* This service file is part of item.
|
||||
*
|
||||
* @author ctexthuang
|
||||
* @contact ctexthuang@qq.com
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Service\Admin\User;
|
||||
|
||||
use App\Lib\AdminReturn;
|
||||
use App\Service\Admin\BaseService;
|
||||
|
||||
class LoginService extends BaseService
|
||||
{
|
||||
public function handle(): array
|
||||
{
|
||||
return AdminReturn::success();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user