feat: 新增周末契约盲盒功能,首页重构为双模式入口

- 新增 BlindBoxIdea 数据模型及 migration
- 新增盲盒 API (提交想法/查询/抽取)
- 新增周末契约盲盒页面 (动效震动+彩带开奖)
- 原首页功能拆分至 /panic 路由
- 首页重构为极速救场 + 周末契约双卡片入口
This commit is contained in:
2026-02-26 11:27:10 +08:00
parent 30d5ad5ff2
commit 7d51f5200d
7 changed files with 1361 additions and 581 deletions
@@ -0,0 +1,47 @@
-- CreateTable
CREATE TABLE "User" (
"id" TEXT NOT NULL PRIMARY KEY,
"username" TEXT NOT NULL,
"passwordHash" TEXT NOT NULL,
"avatar" TEXT NOT NULL DEFAULT '🐱',
"email" TEXT,
"preferences" TEXT NOT NULL DEFAULT '{}',
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- CreateTable
CREATE TABLE "Decision" (
"id" TEXT NOT NULL PRIMARY KEY,
"userId" TEXT NOT NULL,
"roomId" TEXT NOT NULL,
"restaurantName" TEXT NOT NULL,
"restaurantData" TEXT NOT NULL,
"matchType" TEXT NOT NULL,
"participants" INTEGER NOT NULL,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "Decision_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
-- CreateTable
CREATE TABLE "Favorite" (
"id" TEXT NOT NULL PRIMARY KEY,
"userId" TEXT NOT NULL,
"restaurantData" TEXT NOT NULL,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "Favorite_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
-- CreateTable
CREATE TABLE "BlindBoxIdea" (
"id" TEXT NOT NULL PRIMARY KEY,
"roomId" TEXT NOT NULL,
"content" TEXT NOT NULL,
"status" TEXT NOT NULL DEFAULT 'in_pool',
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- CreateIndex
CREATE UNIQUE INDEX "User_username_key" ON "User"("username");
-- CreateIndex
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
+8
View File
@@ -45,3 +45,11 @@ model Favorite {
createdAt DateTime @default(now())
user User @relation(fields: [userId], references: [id])
}
model BlindBoxIdea {
id String @id @default(uuid())
roomId String
content String
status String @default("in_pool")
createdAt DateTime @default(now())
}