This commit is contained in:
zimoyin
2026-04-06 20:48:32 +08:00
parent 76e9f24aa7
commit 13fd9c5f0a
77 changed files with 6034 additions and 42 deletions
@@ -0,0 +1,32 @@
<?php
namespace plugin\admin\app\repository;
use plugin\admin\app\model\OpmDsWarnRule;
use plugin\admin\app\repository\exception\EntityNotFoundException;
class WarnRuleRepository extends BaseRepository
{
public function __construct()
{
$this->model = new OpmDsWarnRule;
}
public static function new(): WarnRuleRepository
{
return new self();
}
/**
* 根据ID查找报警规则
* @throws EntityNotFoundException
*/
public function findOrFail(int $id): OpmDsWarnRule
{
$rule = $this->scopedQuery()->find($id);
if (!$rule) {
throw new EntityNotFoundException('报警规则不存在');
}
return $rule;
}
}