dd/app/Services/Tg/Hook/Mod/CacheTg.php
2026-01-22 19:08:25 +08:00

54 lines
1.5 KiB
PHP
Executable File

<?php
namespace App\Services\Tg\Hook\Mod;
//use App\Models\ArticleSchema as ModelArticleSchema;
use App\Models\CacheTg as ModelCacheTg;
//use App\Models\ArticleCacheTime as ModelArticleCacheTime;
use App\Services\Tg\Hook\Dog;
//use App\Services\Article\CacheTg as ServiceArticleCacheTg;
//use App\Services\Article\Schema as ServiceArticleSchema;
//use App\Services\Article\Cmd as ServiceArticleCmd;
//use App\Services\TomTool\Flow;
////use App\Services\HttpQueue;
//use App\Services\TomTool\TelegramVdb;
//use App\Services\TomTool\ThrowableHandler;
//use Illuminate\Database\QueryException;
//use RuntimeException;
//use App\Services\TomTool\HttpV2;
//use App\Services\Cron\ArticleSchema as CronArticleSchema;
use App\Services\CacheTg as ServiceCacheTg;
class CacheTg extends Base {
private $oDog;
private $aUpdate;
public function __construct($aUpdate)
{
$this->oDog = new Dog(new ModelCacheTg());
$this->oDog->_setDogName("cacheTg");
$this->oDog->_setStrField(["content"]);
$this->aUpdate = $aUpdate;
}
public function add($aParam)
{
$sFromGroupCode = $aParam["aOption"][1] ?? "ffq_tg_a";
$sContent = implode(' ', $aParam["aArg"]);
$oServicesCacheTg = new ServiceCacheTg();
$oFlow = $oServicesCacheTg->add($sContent, $sFromGroupCode);
$sMsg = '';
if ($oFlow->isDone()) {
$sMsg = $sFromGroupCode."添加一条缓存";
}
return $sMsg;
}
}