first commit

This commit is contained in:
2025-09-12 15:23:08 +08:00
commit a80c237bbb
117 changed files with 15628 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
use App\Constants\Model\AdminUser\AdminUserStatusCode;
use App\Constants\Model\AdminUser\AdminUserTypeCode;
use App\Model\AdminRole;
use App\Model\AdminUser;
use Hyperf\Database\Seeders\Seeder;
class AdminUserSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run(): void
{
AdminUser::truncate();
AdminRole::truncate();
$entity = AdminUser::create([
'username' => 'admin',
'user_type' => AdminUserTypeCode::SYSTEM,
'nickname' => '超级管理员',
'email' => 'admin@example.com',
'phone' => '18888888888',
'signed' => '人生只似风前絮,欢也零星,悲也零星',
'created_by' => 0,
'updated_by' => 0,
'status' => AdminUserStatusCode::Normal,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
]);
$role = AdminRole::create([
'name' => '超级管理员',
'code' => 'SuperAdmin',
]);
$entity->roles()->sync($role);
}
}