初始化

This commit is contained in:
2026-08-08 18:27:38 +08:00
parent efc150c937
commit 060eb79c09
336 changed files with 24613 additions and 15 deletions
+54
View File
@@ -0,0 +1,54 @@
<?php
namespace Database\Seeders;
use App\Models\GlossaryTerm;
use Illuminate\Database\Seeder;
class GlossaryTermSeeder extends Seeder
{
public function run(): void
{
$terms = [
[
'term' => 'PD (Power Delivery)',
'slug' => 'pd-power-delivery',
'definition' => 'USB Power Delivery 协议,通过 USB-C 接口传输最高 240W (48V/5A) 的电力,支持双向供电和智能功率协商。',
'aliases' => 'USB PD, Power Delivery, 快充协议',
'category' => '协议',
],
[
'term' => 'PHY (物理层)',
'slug' => 'phy-physical-layer',
'definition' => 'PHY 是物理层(Physical Layer)的缩写,负责数据的物理传输,包括信号编码、调制解调、阻抗匹配等功能。',
'aliases' => 'Physical Layer, 物理层收发器',
'category' => '硬件',
],
[
'term' => 'PPS (可编程电源)',
'slug' => 'pps-programmable-power-supply',
'definition' => 'PPS 是 USB PD3.X 中的可编程电源模式,允许在 3.3V 到 21V 范围内以 20mV 步进调整输出电压,实现更高效的直充方案。',
'aliases' => 'Programmable Power Supply',
'category' => '协议',
],
[
'term' => 'BC1.2',
'slug' => 'bc1-2',
'definition' => 'Battery Charging Specification 1.2USB-IF 制定的电池充电规范,定义了 DCP(专用充电口)、CDP(充电下行口)和 SDP(标准下行口)三种充电模式。',
'aliases' => 'Battery Charging 1.2',
'category' => '协议',
],
[
'term' => '同步整流',
'slug' => 'synchronous-rectification',
'definition' => '同步整流是用 MOSFET 替代肖特基二极管进行整流的技术,可大幅降低整流损耗,提升转换效率至 95% 以上。',
'aliases' => 'Synchronous Rectification, SR',
'category' => '硬件',
],
];
foreach ($terms as $item) {
GlossaryTerm::firstOrCreate(['slug' => $item['slug']], $item);
}
}
}