From 869df3e01455c6bed785cd1346257a244dc128cd Mon Sep 17 00:00:00 2001 From: chengxl Date: Mon, 1 Sep 2025 14:09:43 +0800 Subject: [PATCH 01/21] =?UTF-8?q?=E7=BB=88=E5=AE=A1=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Finalreview.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/api/controller/Finalreview.php b/application/api/controller/Finalreview.php index 6f150d3..268ede2 100644 --- a/application/api/controller/Finalreview.php +++ b/application/api/controller/Finalreview.php @@ -15,14 +15,14 @@ class Finalreview extends Base private $aEmailConfig = [ 'reviewer' => [ - 'email_subject' => 'Invitation for Final Review of Manuscript - {journal_title} [{accept_sn}]', + 'email_subject' => 'Invitation for Final Decision of Manuscript - {journal_title} [{accept_sn}]', 'email_content' => ' Dear Prof. {realname},

I hope this message finds you well.

- We would like to invite you to conduct the final review of the manuscript detailed below:
+ We would like to invite you to conduct the final decision of the manuscript detailed below:
Title: [{article_title}]
Manuscript ID: [{accept_sn}]

- The manuscript has passed the peer review, and revisions have been made based on the external reviewer\'s comments. We would be honored if you could conduct the final review of the manuscript. Your expert opinion is crucial in ensuring the academic quality of the manuscript and determining its final acceptance for publication.

+ The manuscript has passed the peer review, and revisions have been made based on the external reviewer\'s comments. We would be honored if you could conduct the final decision of the manuscript. Your expert opinion is crucial in ensuring the academic quality of the manuscript and determining its final acceptance for publication.

Click here to review the article and kindly submit your final comments within 5 days
Click here to reject the review of this manuscript
Your username: {account}
From 9e3e13c266be37f3f9ad2cbae6462477746eee52 Mon Sep 17 00:00:00 2001 From: chengxl Date: Mon, 1 Sep 2025 15:10:07 +0800 Subject: [PATCH 02/21] =?UTF-8?q?=E7=BB=88=E5=AE=A1=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Finalreview.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/api/controller/Finalreview.php b/application/api/controller/Finalreview.php index 268ede2..f968d6f 100644 --- a/application/api/controller/Finalreview.php +++ b/application/api/controller/Finalreview.php @@ -276,7 +276,7 @@ class Finalreview extends Base ]; //邮箱 - $email = 'tmr@tmrjournals.com';//$aUser['email']; + $email = $aUser['email'];//'tmr@tmrjournals.com';// //用户名 $realname = empty($aUser['account']) ? '' : $aUser['account']; $realname = empty($aUser['realname']) ? $realname : $aUser['realname']; From 4da6039c5f397a7a6fc9d233bbf8f0bc13c3b9e8 Mon Sep 17 00:00:00 2001 From: chengxl Date: Mon, 1 Sep 2025 15:17:41 +0800 Subject: [PATCH 03/21] =?UTF-8?q?=E7=BB=88=E5=AE=A1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Article.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php index 90a7078..a7dc0b5 100644 --- a/application/api/controller/Article.php +++ b/application/api/controller/Article.php @@ -1266,7 +1266,7 @@ class Article extends Base } //添加文章状态信息(如果状态未更新可做通话用,并结束操作) $insert_data['article_id'] = $iId; - $insert_data['content'] = 'The article enters the final review stage'; + $insert_data['content'] = 'final decision'; $insert_data['state_from'] = $article_info['state']; $insert_data['state_to'] = 8; $insert_data['ctime'] = time(); From 58c988e902d98de3f155acbdc3a5c54001a8a46f Mon Sep 17 00:00:00 2001 From: chengxl Date: Tue, 2 Sep 2025 09:33:45 +0800 Subject: [PATCH 04/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/Material.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/common/Material.php b/application/common/Material.php index 8847daa..0ed5770 100644 --- a/application/common/Material.php +++ b/application/common/Material.php @@ -658,7 +658,7 @@ class Material } if($iProgress >= 100){//上传素材完成后【1分钟后推送草稿箱】 $iDelaySeconds = 60;// 1分钟的秒数 - Queue::later($iDelaySeconds,'app\api\job\WechatDraft@fire', ['article_id' => $iId], 'WechatDraft') + Queue::later($iDelaySeconds,'app\api\job\WechatDraft@fire', ['article_id' => $iId], 'WechatDraft'); } return json_encode($aResult); } From 92f3ebca29033c3d0bf524370281a0fa1d0572cb Mon Sep 17 00:00:00 2001 From: chengxl Date: Tue, 2 Sep 2025 09:35:19 +0800 Subject: [PATCH 05/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/job/ArticleAiCreateContent.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/api/job/ArticleAiCreateContent.php b/application/api/job/ArticleAiCreateContent.php index 6a2863d..314077d 100644 --- a/application/api/job/ArticleAiCreateContent.php +++ b/application/api/job/ArticleAiCreateContent.php @@ -53,12 +53,12 @@ class ArticleAiCreateContent $response = $oAiarticle->create($data); // 验证API响应 if (empty($response)) { - throw new RuntimeException("OpenAI API返回空结果"); + throw new \RuntimeException("OpenAI API返回空结果"); } // 检查JSON解析错误 $aResult = json_decode($response, true); if (json_last_error() !== JSON_ERROR_NONE) { - throw new RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); + throw new \RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); } $sMsg = empty($aResult['msg']) ? 'success' : $aResult['msg']; //更新完成标识 From 7712d382b2c4cae531fccf1c547318ddeb3fb52d Mon Sep 17 00:00:00 2001 From: chengxl Date: Tue, 2 Sep 2025 09:37:11 +0800 Subject: [PATCH 06/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/job/ArticleReview.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/api/job/ArticleReview.php b/application/api/job/ArticleReview.php index acdfa6a..2838109 100644 --- a/application/api/job/ArticleReview.php +++ b/application/api/job/ArticleReview.php @@ -56,12 +56,12 @@ class ArticleReview $response = $oAireview->review($data); // 验证API响应 if (empty($response)) { - throw new RuntimeException("OpenAI API返回空结果"); + throw new \RuntimeException("OpenAI API返回空结果"); } // 检查JSON解析错误 $aResult = json_decode($response, true); if (json_last_error() !== JSON_ERROR_NONE) { - throw new RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); + throw new \RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); } $sMsg = empty($aResult['msg']) ? 'success' : $aResult['msg']; //更新完成标识 From 029263313d1448f6cf2723c519a989d8c99b48d2 Mon Sep 17 00:00:00 2001 From: chengxl Date: Tue, 2 Sep 2025 09:37:46 +0800 Subject: [PATCH 07/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/job/ArticleReviewForQueue.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/api/job/ArticleReviewForQueue.php b/application/api/job/ArticleReviewForQueue.php index 9aea199..d8a2e84 100644 --- a/application/api/job/ArticleReviewForQueue.php +++ b/application/api/job/ArticleReviewForQueue.php @@ -54,12 +54,12 @@ class ArticleReviewForQueue $response = $oOpenAi->articleReviewForQueue($data); // 验证API响应 if (empty($response)) { - throw new RuntimeException("OpenAI API返回空结果"); + throw new \RuntimeException("OpenAI API返回空结果"); } // 检查JSON解析错误 $aResult = json_decode($response, true); if (json_last_error() !== JSON_ERROR_NONE) { - throw new RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); + throw new \RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); } $sMsg = empty($aResult['msg']) ? '内容生成成功' : $aResult['msg']; From fe2dbfb3f1860b0027e297ee44abdf3f963c961a Mon Sep 17 00:00:00 2001 From: chengxl Date: Tue, 2 Sep 2025 09:38:27 +0800 Subject: [PATCH 08/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/job/ArticleReviewForQueueChunk.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/api/job/ArticleReviewForQueueChunk.php b/application/api/job/ArticleReviewForQueueChunk.php index 039e3c6..5f7ddc4 100644 --- a/application/api/job/ArticleReviewForQueueChunk.php +++ b/application/api/job/ArticleReviewForQueueChunk.php @@ -54,12 +54,12 @@ class ArticleReviewForQueueChunk $response = $oOpenAi->articleReviewForQueueChunk($data); // 验证API响应 if (empty($response)) { - throw new RuntimeException("OpenAI API返回空结果"); + throw new \RuntimeException("OpenAI API返回空结果"); } // 检查JSON解析错误 $aResult = json_decode($response, true); if (json_last_error() !== JSON_ERROR_NONE) { - throw new RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); + throw new \RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); } $sMsg = empty($aResult['msg']) ? '内容生成成功' : $aResult['msg']; From ee725676017d1f14eaf389c277b6bf7eadf7ae35 Mon Sep 17 00:00:00 2001 From: chengxl Date: Tue, 2 Sep 2025 09:38:58 +0800 Subject: [PATCH 09/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/job/RecommendArticleField.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/api/job/RecommendArticleField.php b/application/api/job/RecommendArticleField.php index 4226db1..437e63c 100644 --- a/application/api/job/RecommendArticleField.php +++ b/application/api/job/RecommendArticleField.php @@ -52,12 +52,12 @@ class RecommendArticleField $response = $oArticle->getAiField($data); // 验证API响应 if (empty($response)) { - throw new RuntimeException("OpenAI API返回空结果"); + throw new \RuntimeException("OpenAI API返回空结果"); } // 检查JSON解析错误 $aResult = json_decode($response, true); if (json_last_error() !== JSON_ERROR_NONE) { - throw new RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); + throw new \RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); } $sMsg = empty($aResult['msg']) ? 'success' : $aResult['msg']; From 9637b30873bd2c8b9170cecaa01e9a7c7c5ab255 Mon Sep 17 00:00:00 2001 From: chengxl Date: Tue, 2 Sep 2025 09:39:37 +0800 Subject: [PATCH 10/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/job/RecommendReviewer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/api/job/RecommendReviewer.php b/application/api/job/RecommendReviewer.php index da8ee74..b9e749c 100644 --- a/application/api/job/RecommendReviewer.php +++ b/application/api/job/RecommendReviewer.php @@ -54,12 +54,12 @@ class RecommendReviewer $response = $oReviewer->recommend($aParam); // 验证API响应 if (empty($response)) { - throw new RuntimeException("OpenAI API返回空结果"); + throw new \RuntimeException("OpenAI API返回空结果"); } // 检查JSON解析错误 $aResult = json_decode($response, true); if (json_last_error() !== JSON_ERROR_NONE) { - throw new RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); + throw new \RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); } $iStatus = empty($aResult['status']) ? 0 : $aResult['status']; $sMsg = empty($aResult['msg']) ? '' : $aResult['msg']; From 21d87fff91e1842f5a42a835d0e8f6c60fbc2f97 Mon Sep 17 00:00:00 2001 From: chengxl Date: Tue, 2 Sep 2025 09:40:46 +0800 Subject: [PATCH 11/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/job/RelatedArticle.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/api/job/RelatedArticle.php b/application/api/job/RelatedArticle.php index 59e4c1b..d947f4e 100644 --- a/application/api/job/RelatedArticle.php +++ b/application/api/job/RelatedArticle.php @@ -52,12 +52,12 @@ class RelatedArticle $response = JournalArticle::get($data); // 验证API响应 if (empty($response)) { - throw new RuntimeException("OpenAI API返回空结果"); + throw new \RuntimeException("OpenAI API返回空结果"); } // 检查JSON解析错误 $aResult = json_decode($response, true); if (json_last_error() !== JSON_ERROR_NONE) { - throw new RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); + throw new \RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); } $sMsg = empty($aResult['msg']) ? '获取相关文章信息失败' : $aResult['msg']; From 771bd9a65741e58575afbf62be3e2228010ef9a6 Mon Sep 17 00:00:00 2001 From: chengxl Date: Tue, 2 Sep 2025 09:41:20 +0800 Subject: [PATCH 12/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/job/ReviewerScore.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/api/job/ReviewerScore.php b/application/api/job/ReviewerScore.php index cbd28ee..ca3950d 100644 --- a/application/api/job/ReviewerScore.php +++ b/application/api/job/ReviewerScore.php @@ -57,12 +57,12 @@ class ReviewerScore $response = $oReviewer->score($aParam); // 验证API响应 if (empty($response)) { - throw new RuntimeException("OpenAI API返回空结果"); + throw new \RuntimeException("OpenAI API返回空结果"); } // 检查JSON解析错误 $aResult = json_decode($response, true); if (json_last_error() !== JSON_ERROR_NONE) { - throw new RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); + throw new \RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); } $sMsg = empty($aResult['msg']) ? '给审稿人评分处理失败' : $aResult['msg']; From bd3cae7818878aa1ab2cfe185197cc21f7c295d7 Mon Sep 17 00:00:00 2001 From: chengxl Date: Tue, 2 Sep 2025 09:41:53 +0800 Subject: [PATCH 13/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/job/RevisionReviewer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/api/job/RevisionReviewer.php b/application/api/job/RevisionReviewer.php index ecc1e52..1f38213 100644 --- a/application/api/job/RevisionReviewer.php +++ b/application/api/job/RevisionReviewer.php @@ -54,12 +54,12 @@ class RevisionReviewer $response = $oReviewer->revisionForReviewer($aParam); // 验证API响应 if (empty($response)) { - throw new RuntimeException("OpenAI API返回空结果"); + throw new \RuntimeException("OpenAI API返回空结果"); } // 检查JSON解析错误 $aResult = json_decode($response, true); if (json_last_error() !== JSON_ERROR_NONE) { - throw new RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); + throw new \RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); } $sMsg = empty($aResult['msg']) ? '审稿人同意审稿但超时未审的数据失败' : $aResult['msg']; From 700dbc26f6fc1efc4e967f489c765bf814cec965 Mon Sep 17 00:00:00 2001 From: chengxl Date: Tue, 2 Sep 2025 09:42:38 +0800 Subject: [PATCH 14/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/job/WechatDraft.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/api/job/WechatDraft.php b/application/api/job/WechatDraft.php index fe2de53..84cfefe 100644 --- a/application/api/job/WechatDraft.php +++ b/application/api/job/WechatDraft.php @@ -52,12 +52,12 @@ class WechatDraft $response = $oAiarticle->syncWechat($data); // 验证API响应 if (empty($response)) { - throw new RuntimeException("OpenAI API返回空结果"); + throw new \RuntimeException("OpenAI API返回空结果"); } // 检查JSON解析错误 $aResult = json_decode($response, true); if (json_last_error() !== JSON_ERROR_NONE) { - throw new RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); + throw new \RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); } $sMsg = empty($aResult['msg']) ? '上传草稿箱失败' : $aResult['msg']; From 0fa43f178d439f57b0590307409786edf3e41d91 Mon Sep 17 00:00:00 2001 From: chengxl Date: Tue, 2 Sep 2025 09:43:14 +0800 Subject: [PATCH 15/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/job/WechatDraftPublish.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/api/job/WechatDraftPublish.php b/application/api/job/WechatDraftPublish.php index f71563e..ebe94bd 100644 --- a/application/api/job/WechatDraftPublish.php +++ b/application/api/job/WechatDraftPublish.php @@ -52,12 +52,12 @@ class WechatDraftPublish $response = $oAiarticle->publishDraft($data); // 验证API响应 if (empty($response)) { - throw new RuntimeException("OpenAI API返回空结果"); + throw new \RuntimeException("OpenAI API返回空结果"); } // 检查JSON解析错误 $aResult = json_decode($response, true); if (json_last_error() !== JSON_ERROR_NONE) { - throw new RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); + throw new \RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); } $sMsg = empty($aResult['msg']) ? '草稿箱发布失败' : $aResult['msg']; From b3d4f7b33bcff75a1723c76891477375187c4632 Mon Sep 17 00:00:00 2001 From: chengxl Date: Tue, 2 Sep 2025 09:43:45 +0800 Subject: [PATCH 16/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/job/WechatMaterial.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/api/job/WechatMaterial.php b/application/api/job/WechatMaterial.php index 90a3e5d..d676f78 100644 --- a/application/api/job/WechatMaterial.php +++ b/application/api/job/WechatMaterial.php @@ -52,12 +52,12 @@ class WechatMaterial $response = $oAiarticle->uploadMaterial($data); // 验证API响应 if (empty($response)) { - throw new RuntimeException("OpenAI API返回空结果"); + throw new \RuntimeException("OpenAI API返回空结果"); } // 检查JSON解析错误 $aResult = json_decode($response, true); if (json_last_error() !== JSON_ERROR_NONE) { - throw new RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); + throw new \RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); } $sMsg = empty($aResult['msg']) ? '上传素材失败' : $aResult['msg']; From 8cdc1712f31ca5c52e88bf62004880d570f1f61c Mon Sep 17 00:00:00 2001 From: chengxl Date: Tue, 2 Sep 2025 09:45:17 +0800 Subject: [PATCH 17/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/job/WechatQueryStatus.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/api/job/WechatQueryStatus.php b/application/api/job/WechatQueryStatus.php index ba1291b..3458e87 100644 --- a/application/api/job/WechatQueryStatus.php +++ b/application/api/job/WechatQueryStatus.php @@ -52,12 +52,12 @@ class WechatQueryStatus $response = $oAiarticle->queryStatus($data); // 验证API响应 if (empty($response)) { - throw new RuntimeException("OpenAI API返回空结果"); + throw new \RuntimeException("OpenAI API返回空结果"); } // 检查JSON解析错误 $aResult = json_decode($response, true); if (json_last_error() !== JSON_ERROR_NONE) { - throw new RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); + throw new \RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); } $sMsg = empty($aResult['msg']) ? '查询草稿箱文章是否发布失败' : $aResult['msg']; From 4337d323492f6e0e221bb1950e37e67a3001c9b7 Mon Sep 17 00:00:00 2001 From: chengxl Date: Tue, 2 Sep 2025 09:45:46 +0800 Subject: [PATCH 18/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/job/createFieldForQueue.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/api/job/createFieldForQueue.php b/application/api/job/createFieldForQueue.php index 5458880..57f3c23 100644 --- a/application/api/job/createFieldForQueue.php +++ b/application/api/job/createFieldForQueue.php @@ -54,12 +54,12 @@ class CreateFieldForQueue $response = $oOpenAi->createFieldForQueue($data); // 验证API响应 if (empty($response)) { - throw new RuntimeException("OpenAI API返回空结果"); + throw new \RuntimeException("OpenAI API返回空结果"); } // 检查JSON解析错误 $aResult = json_decode($response, true); if (json_last_error() !== JSON_ERROR_NONE) { - throw new RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); + throw new \RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); } $sMsg = empty($aResult['msg']) ? '内容生成成功' : $aResult['msg']; From 45dc6ad6cef15abcbd63944abe3f64ad92ca6809 Mon Sep 17 00:00:00 2001 From: chengxl Date: Tue, 2 Sep 2025 09:46:12 +0800 Subject: [PATCH 19/21] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/job/uploadMaterialStep.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/api/job/uploadMaterialStep.php b/application/api/job/uploadMaterialStep.php index 98bbba9..219d0f7 100644 --- a/application/api/job/uploadMaterialStep.php +++ b/application/api/job/uploadMaterialStep.php @@ -56,12 +56,12 @@ class uploadMaterialStep $response = $oMaterial->uploadMaterialStep($data); // 验证API响应 if (empty($response)) { - throw new RuntimeException("OpenAI API返回空结果"); + throw new \RuntimeException("OpenAI API返回空结果"); } // 检查JSON解析错误 $aResult = json_decode($response, true); if (json_last_error() !== JSON_ERROR_NONE) { - throw new RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); + throw new \RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); } $sMsg = empty($aResult['msg']) ? '素材上传失败' : $aResult['msg']; From 4e753c0d647e513147c333cbd9944f8e92a4ed25 Mon Sep 17 00:00:00 2001 From: chengxl Date: Tue, 2 Sep 2025 09:49:17 +0800 Subject: [PATCH 20/21] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E9=98=9F=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/job/ProofRead.php | 79 +++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 application/api/job/ProofRead.php diff --git a/application/api/job/ProofRead.php b/application/api/job/ProofRead.php new file mode 100644 index 0000000..ff99882 --- /dev/null +++ b/application/api/job/ProofRead.php @@ -0,0 +1,79 @@ +oQueueJob = new QueueJob; + $this->QueueRedis = QueueRedis::getInstance(); + } + + public function fire(Job $job, $data) + { + //任务开始判断 + $this->oQueueJob->init($job); + + // 获取 Redis 任务的原始数据 + $rawBody = empty($job->getRawBody()) ? '' : $job->getRawBody(); + $jobData = empty($rawBody) ? [] : json_decode($rawBody, true); + $jobId = empty($jobData['id']) ? 'unknown' : $jobData['id']; + + $this->oQueueJob->log("-----------队列任务开始-----------"); + $this->oQueueJob->log("当前任务ID: {$jobId}, 尝试次数: {$job->attempts()}"); + + // 获取文章ID + $iArticleId = empty($data['article_id']) ? 0 : $data['article_id']; + if (empty($iArticleId)) { + $this->oQueueJob->log("无效的article_id,删除任务"); + $job->delete(); + return; + } + try { + + // 生成Redis键并尝试获取锁 + $sClassName = get_class($this); + $sRedisKey = "queue_job:{$sClassName}:{$iArticleId}"; + $sRedisValue = uniqid() . '_' . getmypid(); + if (!$this->oQueueJob->acquireLock($sRedisKey, $sRedisValue, $job)) { + return; // 未获取到锁,已处理 + } + + //生成内容 + $oAireview = new Aireview; + $response = $oAireview->proofRead($data); + var_dump($response); + // // 验证API响应 + // if (empty($response)) { + // throw new \RuntimeException("OpenAI API返回空结果"); + // } + // // 检查JSON解析错误 + // $aResult = json_decode($response, true); + // if (json_last_error() !== JSON_ERROR_NONE) { + // throw new \RuntimeException("解析OpenAI响应失败: " . json_last_error_msg() . " | 原始响应: {$response}"); + // } + $sMsg = empty($aResult['msg']) ? 'success' : $aResult['msg']; + //更新完成标识 + $this->QueueRedis->finishJob($sRedisKey, 'completed', $this->completedExprie,$sRedisValue); + $job->delete(); + $this->oQueueJob->log("任务执行成功 | 日志ID: {$sRedisKey} | 执行日志:{$sMsg}"); + + } catch (\RuntimeException $e) { + $this->oQueueJob->handleRetryableException($e,$sRedisKey,$sRedisValue, $job); + } catch (\LogicException $e) { + $this->oQueueJob->handleNonRetryableException($e,$sRedisKey,$sRedisValue, $job); + } catch (\Exception $e) { + $this->oQueueJob->handleRetryableException($e,$sRedisKey,$sRedisValue, $job); + } finally { + $this->oQueueJob->finnal(); + } + } +} \ No newline at end of file From 97baf3b45f726c2a0df2a5269e6d9120394e5fbe Mon Sep 17 00:00:00 2001 From: chengxl Date: Tue, 2 Sep 2025 09:58:52 +0800 Subject: [PATCH 21/21] =?UTF-8?q?=E6=AD=A3=E5=88=99=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Aiarticle.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/api/controller/Aiarticle.php b/application/api/controller/Aiarticle.php index 520f350..eecd549 100644 --- a/application/api/controller/Aiarticle.php +++ b/application/api/controller/Aiarticle.php @@ -1536,7 +1536,7 @@ class Aiarticle extends Base $sTitle = empty($aMainImageInfo['title']) ? strip_tags($aMainImageInfo['note']) : strip_tags($aMainImageInfo['title']); $aImageSerach['{###image_title###}'] = ''; if(!empty($sTitle)){ - $sTitle = preg_replace('/Figure \d+.*?/i', '', $sTitle); + $sTitle = preg_replace('/Figure \d+\s*/i', '', $sTitle); $aTitle = explode('.', $sTitle); $aImageSerach['{###image_title###}'] = empty($aTitle[0]) ? $sTitle : strip_tags($aTitle[0]); }