From 764733d76e119bf563c2619b94df4b89630c8792 Mon Sep 17 00:00:00 2001 From: hellcat Date: Mon, 27 Jul 2026 18:09:17 +0800 Subject: [PATCH] no message --- .../Api/ArticleSchemaController.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/app/Http/Controllers/Api/ArticleSchemaController.php b/app/Http/Controllers/Api/ArticleSchemaController.php index 29c9de1..d873358 100644 --- a/app/Http/Controllers/Api/ArticleSchemaController.php +++ b/app/Http/Controllers/Api/ArticleSchemaController.php @@ -93,6 +93,7 @@ private function cmdSaveArticle(): string // 番号匹配 $aResults = match ($this->sGroupCode) { 'tg_xiuren_a' => $this->groupXiurenHandler($aArticle), + 'tg_image' => $this->groupImageHandler($aArticle), default => throw new Exception("番号 {$this->sGroupCode} 未在编制内"), }; @@ -120,6 +121,25 @@ private function groupXiurenHandler(array $aArticle): array } return $aStatus; } + + private function groupImageHandler(array $aArticle): array + { + $aStatus = []; + + foreach ($aArticle as $aRow) { + $sRowType = $aRow["type"] ?? ''; + $aRowData = $aRow["data"] ?? []; + + if (empty($aRowData)) continue; + + // 类型匹配 + $aStatus[] = match ($sRowType) { + 'photo' => $this->typePhotoHandler($aRowData), + default => "跳过未知类型: {$sRowType}", + }; + } + return $aStatus; + } /** * 【类型级】图片处理处置官