mirror of
https://gitee.com/ctexthuang/hyperf_rbac_framework_server_ctexthuang.git
synced 2025-12-25 19:27:48 +08:00
feat : admin log
This commit is contained in:
51
app/Service/Admin/Log/AdminUserLoginLogService.php
Normal file
51
app/Service/Admin/Log/AdminUserLoginLogService.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* This service file is part of item.
|
||||
*
|
||||
* @author ctexthuang
|
||||
* @contact ctexthuang@qq.com
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Service\Admin\Log;
|
||||
|
||||
use App\Exception\ErrException;
|
||||
use App\Repository\AdminUserLoginLogRepository;
|
||||
use App\Service\Admin\BaseAdminService;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
|
||||
class AdminUserLoginLogService extends BaseAdminService
|
||||
{
|
||||
/**
|
||||
* @var AdminUserLoginLogRepository
|
||||
*/
|
||||
#[Inject]
|
||||
protected AdminUserLoginLogRepository $adminUserLoginLogRepository;
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function handle(): array
|
||||
{
|
||||
return $this->adminReturn->success(
|
||||
'success',
|
||||
$this->adminUserLoginLogRepository->page(
|
||||
$this->getRequestData(),
|
||||
$this->getCurrentPage(),
|
||||
$this->getPageSize()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function deleteLog(): array
|
||||
{
|
||||
if (!$this->adminUserLoginLogRepository->deleteById($this->request->input('ids')))
|
||||
throw new ErrException('删除失败');
|
||||
|
||||
return $this->adminReturn->success();
|
||||
}
|
||||
}
|
||||
51
app/Service/Admin/Log/AdminUserOperationLogService.php
Normal file
51
app/Service/Admin/Log/AdminUserOperationLogService.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* This service file is part of item.
|
||||
*
|
||||
* @author ctexthuang
|
||||
* @contact ctexthuang@qq.com
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Service\Admin\Log;
|
||||
|
||||
use App\Exception\ErrException;
|
||||
use App\Repository\AdminUserOperationLogRepository;
|
||||
use App\Service\Admin\BaseAdminService;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
|
||||
class AdminUserOperationLogService extends BaseAdminService
|
||||
{
|
||||
/**
|
||||
* @var AdminUserOperationLogRepository
|
||||
*/
|
||||
#[Inject]
|
||||
protected AdminUserOperationLogRepository $adminUserOperationLogRepository;
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function handle(): array
|
||||
{
|
||||
return $this->adminReturn->success(
|
||||
'success',
|
||||
$this->adminUserOperationLogRepository->page(
|
||||
$this->getRequestData(),
|
||||
$this->getCurrentPage(),
|
||||
$this->getPageSize()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function deleteLog(): array
|
||||
{
|
||||
if (!$this->adminUserOperationLogRepository->deleteById($this->request->input('ids')))
|
||||
throw new ErrException('删除失败');
|
||||
|
||||
return $this->adminReturn->success();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user