oDog = new Dog(new ModelArticleSchema()); $this->oDog->_setDogName("articleSchema"); $this->oDog->_setStrField(["content"]); $this->aUpdate = $aUpdate; } public function __call($sName, $aArg) { return $this->oDog->$sName($aArg[0]); } public function test_cron_saveAuto() { $r = ServiceArticleSchema::make()->cron_saveAuto(); return $r; } public function build_test_ttcp($aParam) { $oArticleCodeFirst = ModelArticleSchema::where("status", 1)->orderBy("id", "desc")->first(); $aArg["sArticleCode"] = $oArticleCodeFirst->code; $aArg["sFromCode"] = 'ttcp'; $aArg["sFromName"] = '天天测评'; $aArg["sFromUrl"] = 'ttcp.loc'; $aArg["sFromGroup"] = 'vue_md_ceping'; $aParam["aArg"][1] = json_encode($aArg); $r = $this->build_test($aParam); } public function build_test($aParam) { $aJson = $aParam["aArg"]; $sJson = implode(" ", $aJson); $aJson = json_decode($sJson, true); $sShell = $this->aUpdate["shell"] ?? ''; $aJson["isTest"] = true; $url = $_ENV["APP_URL"]."/api/article/build"; $r = HttpV2::make($url)->enableJsonSend()->setData($aJson)->send(); $a = json_decode($r, true); if ($sShell !== "cmd") { $oTelegramVdb = TelegramVdb::make("master"); foreach ($a["aData"] as $aa) { $oTelegramVdb->send($aa); } } echo "标题:".$a["aData"]["title"] ?? "?"; echo "
"; echo $a["aData"]["content"] ?? "?"; exit; } public function build_test_case($aParam) { $aArg["sArticleCode"] = 'ffq_tg::20251028113221'; $aArg["sFromCode"] = 'ttcp'; $aArg["sFromName"] = '天天测评'; $aArg["sFromUrl"] = 'ttcp.loc'; $aArg["sFromGroup"] = 'vue_md_ceping'; return $this->toJson($aArg); } public function cmdReset($aParam) { $xId = $aParam["aArg"][1] ?? "first"; if ($xId == "?") { return "#cmdRe [xId:first]"; } if ($xId == "first") { $oModelArticleSchema = ModelArticleSchema::where("status", 1)->orderBy("id", "desc")->first(); } else { $oModelArticleSchema = ModelArticleSchema::where("status", 1)->where("id", $xId)->first(); } $oModelArticleSchema->enable_sync = true; $oModelArticleSchema->save(); $bool = ServiceArticleCmd::start($oModelArticleSchema->code)->reset(); return $bool; } public function cmdGet($aParam) { $xId = $aParam["aArg"][1] ?? "first"; if ($xId == "?") { return "#cmdGet [xId:first]"; } if ($xId == "first") { $oModelArticleSchema = ModelArticleSchema::where("status", 1)->orderBy("id", "desc")->first(); } else { $oModelArticleSchema = ModelArticleSchema::where("status", 1)->where("id", $xId)->first(); } return json_decode($oModelArticleSchema->cmd, true); } public function schemaGet($aParam) { $xId = $aParam["aArg"][1] ?? "first"; if ($xId == "?") { return "#schemaGet [xId:first]"; } if ($xId == "first") { $oModelArticleSchema = ModelArticleSchema::where("status", 1)->orderBy("id", "desc")->first(); } else { $oModelArticleSchema = ModelArticleSchema::where("status", 1)->where("id", $xId)->first(); } $aSchema = json_decode($oModelArticleSchema->schema, true); $sMsg = json_encode($aSchema, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT); return $sMsg; } public function cacheAdd($aParam) { $sFromGroupCode = $aParam["aOption"][1] ?? "ffq_tg_a"; $sContent = implode(' ', $aParam["aArg"]); $r = ServiceArticleCacheTg::start()->add($sFromGroupCode, $sContent); return $r; } // public function save($aParam) // { // $r = ServiceArticleSchema::make()->save(); // // return $r; // } }