feat: 发布智能体版

This commit is contained in:
augushong
2026-03-26 20:22:34 +08:00
parent 7ee9e102a5
commit 8cc08bcb8c
138 changed files with 7964 additions and 660 deletions

View File

@@ -2,8 +2,8 @@
namespace base\common\command\tools\db;
use base\common\service\ToolsDbServiceBase;
use think\console\Command;
use app\common\service\tools\DbService;
use app\common\console\Command;
use think\console\Input;
use think\console\input\Option;
use think\console\Output;
@@ -13,6 +13,8 @@ class ToolsDbTableBase extends Command
{
protected function configure()
{
parent::configure();
$this->setName('tools:db:table')
->setDescription('使用查询构建器操作表')
->addArgument('table', null, '表名')
@@ -28,12 +30,12 @@ class ToolsDbTableBase extends Command
protected function execute($input, $output)
{
if ($input->getOption('help')) {
$service = new ToolsDbServiceBase();
$service = new DbService();
$service->showHelp('tools:db:table', $output);
return;
}
$service = new ToolsDbServiceBase();
$service = new DbService();
if (!$service->checkDebugMode($output)) {
return;
@@ -75,10 +77,11 @@ class ToolsDbTableBase extends Command
if ($count) {
$result = $query->count();
$output->writeln('');
$output->writeln('<info>表名:' . $fullTableName . '</info>');
$output->newLine();
$output->info('表名:' . $fullTableName);
$output->writeln('记录数:' . $result);
$output->writeln('');
$output->newLine();
} else {
if ($limit && is_numeric($limit)) {
$query->limit((int)$limit);
@@ -89,17 +92,17 @@ class ToolsDbTableBase extends Command
$endTime = microtime(true);
$executionTime = round(($endTime - $startTime) * 1000, 2);
$output->writeln('');
$output->writeln('<info>表名:' . $fullTableName . '</info>');
$output->newLine();
$output->info('表名:' . $fullTableName);
$service->formatTableOutput($result, $output);
$output->writeln('');
$output->newLine();
$output->writeln('影响行数:' . count($result));
$output->writeln('执行时间:' . $executionTime . 'ms');
$output->writeln('');
$output->newLine();
}
} catch (\Exception $e) {
$output->error('查询失败:' . $e->getMessage());
return;
}
}
}
}