This commit is contained in:
Aether
2025-09-25 09:12:22 +08:00
parent f286e18e71
commit 25aa56439a
13 changed files with 171 additions and 167 deletions

View File

@@ -18,20 +18,10 @@ use Throwable;
*/
abstract class AetherCrudService extends AetherService implements AetherCrudInterface
{
#[Inject]
protected LoggerFactory $loggerFactory;
protected LoggerInterface $logger;
protected array $search = [];
protected array $ignoreSearchFields = [];
public function __construct()
{
$this->logger = $this->loggerFactory->get($this->getLoggerName());
}
/**
* 通用列表查询(支持分页和树形结构).
*/
@@ -85,7 +75,6 @@ abstract class AetherCrudService extends AetherService implements AetherCrudInte
*/
public function detail(int $id): object
{
$this->logger->info('获取资源详情', ['id' => $id]);
return $this->getModel()->findOrFailById($id);
}
@@ -262,14 +251,6 @@ abstract class AetherCrudService extends AetherService implements AetherCrudInte
});
}
/**
* 获取日志名称.
*/
protected function getLoggerName(): string
{
return strtolower((new ReflectionClass($this))->getShortName());
}
protected function getSearch(): array
{
return $this->search;