You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.2 KiB
45 lines
1.2 KiB
<?php
|
|
declare (strict_types = 1);
|
|
|
|
namespace app\command;
|
|
|
|
use app\job\transfer\schedule\CourseScheduleJob;
|
|
use app\job\transfer\schedule\PerformanceCalculation;
|
|
use app\job\transfer\schedule\ResourceAutoAllocation;
|
|
use think\console\Command;
|
|
use think\console\Input;
|
|
use think\console\input\Argument;
|
|
use think\console\input\Option;
|
|
use think\console\Output;
|
|
|
|
class TestCommand extends Command
|
|
{
|
|
protected function configure()
|
|
{
|
|
// 指令配置
|
|
$this->setName('testcommand')
|
|
->setDescription('the testcommand command');
|
|
}
|
|
|
|
protected function execute(Input $input, Output $output)
|
|
{
|
|
// 指令输出
|
|
$output->writeln('开始测试自动排课任务(包含今天)...');
|
|
|
|
try {
|
|
$obj = new CourseScheduleJob();
|
|
$result = $obj->doJob();
|
|
|
|
if ($result) {
|
|
$output->writeln('✅ 自动排课任务执行成功!');
|
|
} else {
|
|
$output->writeln('❌ 自动排课任务执行失败!');
|
|
}
|
|
|
|
} catch (\Exception $e) {
|
|
$output->writeln('❌ 执行异常:' . $e->getMessage());
|
|
}
|
|
|
|
$output->writeln('testcommand');
|
|
}
|
|
}
|
|
|