mirror of
https://gitee.com/ctexthuang/hyperf-micro-svc.git
synced 2026-02-08 10:20:16 +08:00
51 lines
1.2 KiB
PHP
51 lines
1.2 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\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();
|
|
}
|
|
} |