增加测试机制;完善DebugMysql日志逻辑;更新debug_log表字段格式;发布新版本

This commit is contained in:
2024-01-03 16:22:01 +08:00
parent 58bb8166c9
commit e6779f4921
14 changed files with 767 additions and 76 deletions

View File

@@ -0,0 +1,58 @@
<?php
namespace base\common\command;
use app\common\interface\test\CommandTestInterface;
use app\common\service\test\LogTestService;
use think\console\Command;
use think\console\Input;
use think\console\input\Option;
use think\console\Output;
class TestBase extends Command
{
protected $program = [
LogTestService::NAME => LogTestService::class,
];
protected function configure()
{
// 指令配置
$this->setName('test')
->addArgument('program', Option::VALUE_REQUIRED, '测试项目')
->setDescription('the admin:update command');
}
protected function execute(Input $input, Output $output)
{
$program = $input->getArgument('program');
if (empty($program)) {
$output->writeln('请输入测试项目');
return;
}
if (!isset($this->program[$program])) {
$output->writeln('测试项目不存在');
return;
}
$class = $this->program[$program];
$run = $class::RUN;
$instance = new $class();
$output->writeln('测试项目名称:' . $instance->getName());
$output->writeln('测试项目描述:' . $instance->getDesc());
if ($instance instanceof CommandTestInterface) {
$instance->setInput($input);
$instance->setOutput($output);
}
$instance->$run();
}
}