- 前端:全屏Canvas场景,夜空/云朵/草地/大树 - 前端:丝带系统,支持陀螺仪和麦克风交互 - 前端:弹幕许愿展示 - 前端:多棵树切换(祈福树/姻缘树/事业树) - 后端:新增GET /api/wish/trees获取树列表 - 后端:新增GET /api/wish/tree/:id/wishes获取树许愿 - 后端:WishTree模型新增Type、Sort字段 - 后端:AutoMigrate自动处理表结构变更 - 后端:seedDefaultData自动初始化默认数据 - 数据库:wish_trees表新增type、sort字段
This commit is contained in:
@@ -56,7 +56,9 @@ CREATE TABLE IF NOT EXISTS wish_trees (
|
||||
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(50) NOT NULL COMMENT '名称',
|
||||
description VARCHAR(255) DEFAULT '' COMMENT '描述',
|
||||
type VARCHAR(20) DEFAULT 'pine' COMMENT '树类型 pine:松树 sakura:樱花 bamboo:竹子',
|
||||
max_wishes INT DEFAULT 100 COMMENT '最大许愿条数',
|
||||
sort INT DEFAULT 0 COMMENT '排序',
|
||||
status TINYINT DEFAULT 1 COMMENT '状态',
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
@@ -94,8 +96,10 @@ CREATE TABLE IF NOT EXISTS wish_products (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='许愿商品表';
|
||||
|
||||
-- 插入默认许愿树
|
||||
INSERT IGNORE INTO wish_trees (id, name, description, max_wishes) VALUES
|
||||
(1, '祈福许愿树', '许下美好愿望,祈福平安顺遂', 100);
|
||||
INSERT IGNORE INTO wish_trees (id, name, description, type, max_wishes, sort) VALUES
|
||||
(1, '祈福树', '许下美好愿望,祈福平安顺遂', 'pine', 100, 0),
|
||||
(2, '姻缘树', '祈求姻缘美满,爱情甜蜜', 'sakura', 50, 1),
|
||||
(3, '事业树', '祈愿事业顺利,步步高升', 'bamboo', 80, 2);
|
||||
|
||||
-- 插入默认许愿商品
|
||||
INSERT IGNORE INTO wish_products (id, name, description, price, duration, position) VALUES
|
||||
|
||||
Reference in New Issue
Block a user