mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-08-31 05:05:33 +08:00
fix(nginx-log): service 文件加 Service 后缀(命名规范合规)
F2 Code quality review 发现:3 个新增 service 未遵守 .agents/rules/ulthon-naming-convention.md 第 19 行规定 (service 模块文件名需带 Service 后缀)。 变更: - 重命名 6 个文件(3 Base + 3 App): NginxLogParser(Base)→NginxLogParserService(Base) NginxLogReader(Base)→NginxLogReaderService(Base) NginxLogAggregator(Base)→NginxLogAggregatorService(Base) - 同步类名、use、类型 hint、new 引用 - NginxLogReaderServiceBase 异常消息前缀同步加 Service - controller Base 引用更新(NginxLogImportBase / NginxLogStatAggregateBase) 验证: - php -l 全部 8 个文件语法通过 - grep 残留旧名 = 0 结果(24 处引用全部带 Service 后缀)
This commit is contained in:
@@ -67,8 +67,8 @@ class NginxLogImportBase extends TimerController
|
||||
}
|
||||
|
||||
// 3. 依赖倒置:使用 app 层入口类(业务侧可重写拦截)
|
||||
$parser = new \app\common\service\NginxLogParser();
|
||||
$reader = new \app\common\service\NginxLogReader();
|
||||
$parser = new \app\common\service\NginxLogParserService();
|
||||
$reader = new \app\common\service\NginxLogReaderService();
|
||||
|
||||
// 静态资源过滤开关
|
||||
$excludeStatic = (int) sysconfig('nginx_log', 'exclude_static', 1) === 1;
|
||||
@@ -119,8 +119,8 @@ class NginxLogImportBase extends TimerController
|
||||
* @return array{lines:int,fails:int}
|
||||
*/
|
||||
protected function processFile(
|
||||
\app\common\service\NginxLogParser $parser,
|
||||
\app\common\service\NginxLogReader $reader,
|
||||
\app\common\service\NginxLogParserService $parser,
|
||||
\app\common\service\NginxLogReaderService $reader,
|
||||
string $file,
|
||||
bool $excludeStatic
|
||||
): array {
|
||||
@@ -233,7 +233,7 @@ class NginxLogImportBase extends TimerController
|
||||
* 这里取当前 position 后用相同 offset 重写,仅更新 failCount / failSamples。
|
||||
*/
|
||||
protected function updateFailStats(
|
||||
\app\common\service\NginxLogReader $reader,
|
||||
\app\common\service\NginxLogReaderService $reader,
|
||||
string $file,
|
||||
int $fails,
|
||||
array $samples
|
||||
|
||||
Reference in New Issue
Block a user