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.

31 lines
845 B

<?php
namespace App\Console\Commands;
use App\Services\TestData\SupplyDemandTestDataGenerator;
use Illuminate\Console\Command;
class GenerateSupplyDemandDemo extends Command
{
protected $signature = 'demo:generate-supply-demand {--count=50} {--users=20}';
protected $description = '生成供需模块演示数据(含附件、会话、消息、收藏等)';
public function handle(): int
{
$count = (int)$this->option('count');
$users = (int)$this->option('users');
$this->info("开始生成:供需 {$count} 条,最少用户 {$users} 个...");
$generator = new SupplyDemandTestDataGenerator();
$generator->generate($count, $users, function (string $msg) {
$this->line($msg);
});
$this->info('生成完成');
return self::SUCCESS;
}
}