feat: 数据库种子数据全部翻译为英语

This commit is contained in:
2026-09-09 19:59:17 +08:00
parent 10979351f8
commit 4944c02449
6 changed files with 235 additions and 243 deletions

View File

@@ -20,11 +20,11 @@ func seedShopData(db *gorm.DB) error {
// 商品分类
categories := []model.ProductCategory{
{Name: "智能电子", Icon: "electronic", Sort: 1},
{Name: "家居生活", Icon: "home", Sort: 2},
{Name: "时尚服饰", Icon: "fashion", Sort: 3},
{Name: "运动户外", Icon: "sport", Sort: 4},
{Name: "美妆个护", Icon: "beauty", Sort: 5},
{Name: "Smart Electronics", Icon: "electronic", Sort: 1},
{Name: "Home & Living", Icon: "home", Sort: 2},
{Name: "Fashion & Apparel", Icon: "fashion", Sort: 3},
{Name: "Sports & Outdoors", Icon: "sport", Sort: 4},
{Name: "Beauty & Personal Care", Icon: "beauty", Sort: 5},
}
for i := range categories {
if err := db.Create(&categories[i]).Error; err != nil {
@@ -35,32 +35,32 @@ func seedShopData(db *gorm.DB) error {
// 商品数据
products := []model.Product{
// 智能电子
{Name: "无线降噪蓝牙耳机 Pro Max", Description: "主动降噪技术,40 小时超长续航,蓝牙 5.3 芯片,搭载 13mm 动圈单元,Hi-Res 认证音质。支持双设备连接,IPX5 防水等级,适合运动和通勤场景。", Price: 79.99, OriginalPrice: 129.99, CategoryID: 1, Stock: 500, Rating: 4.8, Sales: 12800, Tags: `["热销","新品","限时折扣"]`, Sort: 1, Status: 1},
{Name: "4K 智能投影仪 Home Cinema", Description: "原生 4K 分辨率,3000 ANSI 流明高亮,支持 HDR10+ 和 Dolby Vision。内置 Android TV 系统,自动梯形校正,支持 5G WiFi。家庭影院级体验。", Price: 399.99, OriginalPrice: 599.99, CategoryID: 1, Stock: 200, Rating: 4.7, Sales: 3600, Tags: `["爆款","4K超清"]`, Sort: 2, Status: 1},
{Name: "智能手表 GT Series 5", Description: "1.43 英寸 AMOLED 高清屏,14 天超长续航,支持 100+ 运动模式,血氧心率实时监测,5ATM 防水。蓝牙通话,NFC 支付,智能通知推送。", Price: 149.99, OriginalPrice: 229.99, CategoryID: 1, Stock: 800, Rating: 4.9, Sales: 25600, Tags: `["热销","健康监测"]`, Sort: 3, Status: 1},
{Name: "便携式充电宝 20000mAh", Description: "20000mAh 大容量,PD 65W 快充,可为笔记本充电。支持三设备同时充电,LED 数字显示,航空安全认证,随身携带无忧。", Price: 39.99, OriginalPrice: 59.99, CategoryID: 1, Stock: 1200, Rating: 4.6, Sales: 45000, Tags: `["性价比","快充"]`, Sort: 4, Status: 1},
{Name: "机械键盘 RGB 背光版", Description: "客制化热插拔轴体,PBT 双色注塑键帽,RGB 1680 万色背光,Type-C 有线连接,全键无冲设计。游戏办公两相宜。", Price: 59.99, OriginalPrice: 89.99, CategoryID: 1, Stock: 600, Rating: 4.7, Sales: 8900, Tags: `["游戏","机械轴"]`, Sort: 5, Status: 1},
{Name: "Wireless Noise-Canceling Bluetooth Headphones Pro Max", Description: "Active noise cancellation technology, 40-hour ultra-long battery life, Bluetooth 5.3 chip, equipped with 13mm dynamic drivers, Hi-Res certified audio quality. Supports dual-device connection, IPX5 waterproof rating, perfect for sports and commuting.", Price: 79.99, OriginalPrice: 129.99, CategoryID: 1, Stock: 500, Rating: 4.8, Sales: 12800, Tags: `["Best Seller","New","Limited Discount"]`, Sort: 1, Status: 1},
{Name: "4K Smart Projector Home Cinema", Description: "Native 4K resolution, 3000 ANSI lumens high brightness, supports HDR10+ and Dolby Vision. Built-in Android TV system, automatic keystone correction, supports 5G WiFi. Home theater level experience.", Price: 399.99, OriginalPrice: 599.99, CategoryID: 1, Stock: 200, Rating: 4.7, Sales: 3600, Tags: `["Hot Item","4K Ultra HD"]`, Sort: 2, Status: 1},
{Name: "Smart Watch GT Series 5", Description: "1.43-inch AMOLED HD display, 14-day ultra-long battery life, supports 100+ sport modes, real-time blood oxygen and heart rate monitoring, 5ATM waterproof. Bluetooth calling, NFC payment, smart notification push.", Price: 149.99, OriginalPrice: 229.99, CategoryID: 1, Stock: 800, Rating: 4.9, Sales: 25600, Tags: `["Best Seller","Health Monitoring"]`, Sort: 3, Status: 1},
{Name: "Portable Power Bank 20000mAh", Description: "20000mAh large capacity, PD 65W fast charging, can charge laptops. Supports simultaneous charging of three devices, LED digital display, aviation safety certified, carry with confidence.", Price: 39.99, OriginalPrice: 59.99, CategoryID: 1, Stock: 1200, Rating: 4.6, Sales: 45000, Tags: `["Best Value","Fast Charging"]`, Sort: 4, Status: 1},
{Name: "Mechanical Keyboard RGB Backlit Edition", Description: "Customizable hot-swappable switches, PBT double-shot keycaps, RGB 16.8 million color backlight, Type-C wired connection, full key anti-ghosting design. Perfect for both gaming and office use.", Price: 59.99, OriginalPrice: 89.99, CategoryID: 1, Stock: 600, Rating: 4.7, Sales: 8900, Tags: `["Gaming","Mechanical Switch"]`, Sort: 5, Status: 1},
// 家居生活
{Name: "智能扫地机器人 L10 Pro", Description: "激光导航精准建图,4000Pa 强力吸尘,自动集尘基站,拖扫一体。APP 远程控制,支持多楼层地图,280 分钟超长续航。", Price: 299.99, OriginalPrice: 449.99, CategoryID: 2, Stock: 300, Rating: 4.8, Sales: 6700, Tags: `["热销","激光导航"]`, Sort: 1, Status: 1},
{Name: "空气炸锅 5.5L 大容量", Description: "5.5L 大容量,360° 热风循环,无油健康烹饪。8 种预设菜单,可视化窗口,触控面板,拆卸清洗方便。一锅多用。", Price: 69.99, OriginalPrice: 99.99, CategoryID: 2, Stock: 900, Rating: 4.7, Sales: 18900, Tags: `["爆款","无油烹饪"]`, Sort: 2, Status: 1},
{Name: "记忆棉颈椎枕", Description: "航天级记忆棉材质,人体工学曲线设计,有效缓解颈椎压力。透气亲肤面料,可拆卸水洗,适合各睡姿人群。", Price: 29.99, OriginalPrice: 49.99, CategoryID: 2, Stock: 1500, Rating: 4.6, Sales: 23000, Tags: `["舒适","护颈"]`, Sort: 3, Status: 1},
{Name: "智能香薰加湿器", Description: "超声波雾化技术,7 色氛围灯,静音运行低于 30dB,4L 大容量水箱,定时功能。支持精油香薰,营造舒适居家氛围。", Price: 34.99, OriginalPrice: 54.99, CategoryID: 2, Stock: 700, Rating: 4.5, Sales: 11200, Tags: `["氛围","静音"]`, Sort: 4, Status: 1},
{Name: "Smart Robot Vacuum Cleaner L10 Pro", Description: "LiDAR navigation precise mapping, 4000Pa powerful suction, automatic dust collection base, vacuum and mop combo. APP remote control, supports multi-floor mapping, 280-minute ultra-long battery life.", Price: 299.99, OriginalPrice: 449.99, CategoryID: 2, Stock: 300, Rating: 4.8, Sales: 6700, Tags: `["Best Seller","LiDAR Navigation"]`, Sort: 1, Status: 1},
{Name: "Air Fryer 5.5L Large Capacity", Description: "5.5L large capacity, 360° hot air circulation, oil-free healthy cooking. 8 preset menus, transparent viewing window, touch panel, easy to disassemble and clean. Multi-purpose appliance.", Price: 69.99, OriginalPrice: 99.99, CategoryID: 2, Stock: 900, Rating: 4.7, Sales: 18900, Tags: `["Hot Item","Oil-Free Cooking"]`, Sort: 2, Status: 1},
{Name: "Memory Foam Cervical Pillow", Description: "Aerospace-grade memory foam material, ergonomic curve design, effectively relieves cervical spine pressure. Breathable skin-friendly fabric, removable and washable, suitable for all sleeping positions.", Price: 29.99, OriginalPrice: 49.99, CategoryID: 2, Stock: 1500, Rating: 4.6, Sales: 23000, Tags: `["Comfort","Neck Support"]`, Sort: 3, Status: 1},
{Name: "Smart Aroma Diffuser Humidifier", Description: "Ultrasonic atomization technology, 7-color ambient light, quiet operation below 30dB, 4L large capacity water tank, timer function. Supports essential oil aromatherapy, creates a cozy home atmosphere.", Price: 34.99, OriginalPrice: 54.99, CategoryID: 2, Stock: 700, Rating: 4.5, Sales: 11200, Tags: `["Ambient","Silent"]`, Sort: 4, Status: 1},
// 时尚服饰
{Name: "纯棉重磅 T恤", Description: "280g 重磅纯棉面料,质感挺括不易变形,落肩宽松版型,多色可选。胸前印花设计,街头潮流风格。", Price: 19.99, OriginalPrice: 34.99, CategoryID: 3, Stock: 2000, Rating: 4.6, Sales: 56000, Tags: `["热销","纯棉"]`, Sort: 1, Status: 1},
{Name: "防晒速干运动套装", Description: "UPF50+ 专业防晒,冰丝速干面料,透气排汗。含防晒衣 + 运动裤,适合户外运动、徒步旅行。男女同款。", Price: 49.99, OriginalPrice: 79.99, CategoryID: 3, Stock: 1000, Rating: 4.7, Sales: 15600, Tags: `["防晒","速干"]`, Sort: 2, Status: 1},
{Name: "真皮商务皮带", Description: "头层牛皮材质,自动扣设计,简约商务风格。耐用不易断裂,多尺寸可选,送礼自用皆宜。精美礼盒包装。", Price: 24.99, OriginalPrice: 44.99, CategoryID: 3, Stock: 800, Rating: 4.5, Sales: 9300, Tags: `["真皮","商务"]`, Sort: 3, Status: 1},
{Name: "Premium Heavyweight Cotton T-Shirt", Description: "280g heavyweight cotton fabric, structured and shape-retaining, drop-shoulder relaxed fit, available in multiple colors. Front print design, streetwear style.", Price: 19.99, OriginalPrice: 34.99, CategoryID: 3, Stock: 2000, Rating: 4.6, Sales: 56000, Tags: `["Best Seller","100% Cotton"]`, Sort: 1, Status: 1},
{Name: "UV Protection Quick-Dry Sports Set", Description: "UPF50+ professional sun protection, ice silk quick-dry fabric, breathable and moisture-wicking. Includes sun protection jacket + sports pants, suitable for outdoor activities and hiking. Unisex design.", Price: 49.99, OriginalPrice: 79.99, CategoryID: 3, Stock: 1000, Rating: 4.7, Sales: 15600, Tags: `["UV Protection","Quick-Dry"]`, Sort: 2, Status: 1},
{Name: "Genuine Leather Business Belt", Description: "Top-grain cowhide leather, automatic buckle design, minimalist business style. Durable and resistant to breakage, available in multiple sizes, suitable for gifts or personal use. Elegant gift box packaging.", Price: 24.99, OriginalPrice: 44.99, CategoryID: 3, Stock: 800, Rating: 4.5, Sales: 9300, Tags: `["Genuine Leather","Business"]`, Sort: 3, Status: 1},
// 运动户外
{Name: "专业登山背包 45L", Description: "45L 大容量,防泼水面料,人体工学背负系统,减压透气背板。多隔层设计,含防雨罩,适合长途徒步和登山。", Price: 89.99, OriginalPrice: 139.99, CategoryID: 4, Stock: 400, Rating: 4.8, Sales: 5400, Tags: `["专业","大容量"]`, Sort: 1, Status: 1},
{Name: "瑜伽垫加厚防滑", Description: "TPE 环保材质,8mm 加厚,双面防滑设计,回弹力强。自带对齐辅助线,附绑带和收纳袋。适合瑜伽、健身、冥想。", Price: 22.99, OriginalPrice: 39.99, CategoryID: 4, Stock: 1200, Rating: 4.7, Sales: 21000, Tags: `["环保","防滑"]`, Sort: 2, Status: 1},
{Name: "智能跳绳计数器", Description: "内置高精度传感器,自动计数跳绳次数,蓝牙连接 APP 记录运动数据。钢丝绳可调节长度,防滑手柄,静音轴承。", Price: 14.99, OriginalPrice: 24.99, CategoryID: 4, Stock: 2000, Rating: 4.5, Sales: 34000, Tags: `["智能","性价比"]`, Sort: 3, Status: 1},
{Name: "Professional Hiking Backpack 45L", Description: "45L large capacity, water-resistant fabric, ergonomic carrying system, pressure-reducing breathable back panel. Multi-compartment design, includes rain cover, suitable for long-distance hiking and mountaineering.", Price: 89.99, OriginalPrice: 139.99, CategoryID: 4, Stock: 400, Rating: 4.8, Sales: 5400, Tags: `["Professional","Large Capacity"]`, Sort: 1, Status: 1},
{Name: "Thickened Non-Slip Yoga Mat", Description: "TPE eco-friendly material, 8mm thickened, dual-sided non-slip design, strong resilience. Includes alignment guide lines, carrying strap and storage bag. Suitable for yoga, fitness, and meditation.", Price: 22.99, OriginalPrice: 39.99, CategoryID: 4, Stock: 1200, Rating: 4.7, Sales: 21000, Tags: `["Eco-Friendly","Non-Slip"]`, Sort: 2, Status: 1},
{Name: "Smart Jump Rope with Counter", Description: "Built-in high-precision sensor, automatic jump counting, Bluetooth connection to APP for exercise data tracking. Adjustable steel wire rope length, non-slip handle, silent bearings.", Price: 14.99, OriginalPrice: 24.99, CategoryID: 4, Stock: 2000, Rating: 4.5, Sales: 34000, Tags: `["Smart","Best Value"]`, Sort: 3, Status: 1},
// 美妆个护
{Name: "声波电动牙刷套装", Description: "31000 次/分声波震动,5 种清洁模式,IPX7 全身防水,30 秒换区提醒。含 4 个刷头 + 旅行盒,续航 60 天。", Price: 27.99, OriginalPrice: 49.99, CategoryID: 5, Stock: 1000, Rating: 4.7, Sales: 27800, Tags: `["热销","防水"]`, Sort: 1, Status: 1},
{Name: "纳米离子面部美容仪", Description: "纳米离子导入导出技术,冷热双效护理,红蓝光模式。深层清洁 + 营养导入 + 紧致提升,三合一护肤方案。", Price: 119.99, OriginalPrice: 199.99, CategoryID: 5, Stock: 300, Rating: 4.6, Sales: 4200, Tags: `["美容","三合一"]`, Sort: 2, Status: 1},
{Name: "氨基酸洁面泡沫", Description: "温和氨基酸配方,深层清洁不紧绷,泡沫绵密细腻。含玻尿酸和烟酰胺,洁面同时保湿亮肤。150ml 大容量。", Price: 12.99, OriginalPrice: 19.99, CategoryID: 5, Stock: 3000, Rating: 4.8, Sales: 67000, Tags: `["温和","保湿"]`, Sort: 3, Status: 1},
{Name: "Sonic Electric Toothbrush Set", Description: "31,000 sonic vibrations per minute, 5 cleaning modes, IPX7 full-body waterproof, 30-second interval reminder. Includes 4 brush heads + travel case, 60-day battery life.", Price: 27.99, OriginalPrice: 49.99, CategoryID: 5, Stock: 1000, Rating: 4.7, Sales: 27800, Tags: `["Best Seller","Waterproof"]`, Sort: 1, Status: 1},
{Name: "Nano Ionic Facial Beauty Device", Description: "Nano ionic import and export technology, hot and cold dual-effect care, red and blue light modes. Deep cleansing + nutrient infusion + firming, 3-in-1 skincare solution.", Price: 119.99, OriginalPrice: 199.99, CategoryID: 5, Stock: 300, Rating: 4.6, Sales: 4200, Tags: `["Beauty","3-in-1"]`, Sort: 2, Status: 1},
{Name: "Amino Acid Cleansing Foam", Description: "Gentle amino acid formula, deep cleansing without tightness, dense and fine foam. Contains hyaluronic acid and niacinamide, cleanses while moisturizing and brightening skin. 150ml large capacity.", Price: 12.99, OriginalPrice: 19.99, CategoryID: 5, Stock: 3000, Rating: 4.8, Sales: 67000, Tags: `["Gentle","Moisturizing"]`, Sort: 3, Status: 1},
}
for i := range products {
if err := db.Create(&products[i]).Error; err != nil {