mirror of
https://gitee.com/ctexthuang/hyperf-micro-svc.git
synced 2026-02-08 10:20:16 +08:00
51 lines
1.1 KiB
PHP
51 lines
1.1 KiB
PHP
<?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\Common\Repository\AdminUserLoginLogRepository;
|
|
use App\Exception\ErrException;
|
|
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();
|
|
}
|
|
} |