From 4d844fc5cdeadb305537671a5f793fd583004150 Mon Sep 17 00:00:00 2001 From: chengxl Date: Thu, 19 Jun 2025 14:16:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Aiarticle.php | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/application/api/controller/Aiarticle.php b/application/api/controller/Aiarticle.php index b854c33..316876d 100644 --- a/application/api/controller/Aiarticle.php +++ b/application/api/controller/Aiarticle.php @@ -218,23 +218,6 @@ class Aiarticle extends Base return json_encode(array('status' => 1,'msg' => 'OPENAI successfully generated content','data' => $aContent)); } - /** - * @title AI生成稿件文章 - * @param article_id 文章ID - * @param model 接口模型 - * @param stream 是否流式输出 true是false否 - */ - public function test(){ - //获取参数 - $aParam = $this->request->post(); - $iArticleId = empty($aParam['article_id']) ? '' : $aParam['article_id']; - if(empty($iArticleId)){ - return json_encode(array('status' => 2,'msg' => 'Please select an article' )); - } - - //请求OPENAI生成公微内容 - Queue::push('app\api\job\ArticleAiCreateContent@fire', ['article_id' => $iArticleId], 'ArticleAiCreateContent'); - } public function create($aParam = []){ //获取参数 $aParam = empty($aParam) ? $this->request->post() : $aParam; @@ -1554,6 +1537,11 @@ class Aiarticle extends Base $oMaterial = new Material; $aLog = json_decode($oMaterial->getWechatLog(['article_id' => $iArticleId,'type' => 1,'status' =>1]),true); if(!empty($aLog['data'])){ + $aLog = json_decode($oMaterial->getWechatLog(['article_id' => $iArticleId,'type' => 2,'status' =>1]),true); + if(empty($aLog['data'])){ //推送到草稿箱 + Queue::push('app\api\job\WechatDraft@fire', ['article_id' => $iArticleId], 'WechatDraft'); + return json_encode(['status' => 1,'msg' => 'The article material has been pushed into the draft box queue','data' => []]); + } return json_encode(['status' => 1,'msg' => 'The material has been uploaded','data' => []]); }