9c680ec11e
- 接入 DeepSeek API,提交想法时自动 AI 打标(品类/时段/时长/搜索策略) - 新增行程规划 API:智能选取想法 → 高德 POI 搜索 → AI 生成最优行程 - 支持多日计划("整个周末"拆分周六/周日,并行 AI 调用) - 行程展示逐日翻页,时间线可滚动,操作按钮固定底部 - 分享卡适配多日格式,支持图片保存与原生分享 - Prisma schema 新增 WeekendPlan 模型及 BlindBoxIdea AI 标签字段 - Jenkinsfile 集成 DEEPSEEK_API_KEY 环境变量
129 lines
3.4 KiB
Plaintext
129 lines
3.4 KiB
Plaintext
datasource db {
|
|
provider = "sqlite"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
model Room {
|
|
id String @id
|
|
data String
|
|
createdAt DateTime @default(now())
|
|
expiresAt DateTime
|
|
|
|
@@index([expiresAt])
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(cuid())
|
|
username String @unique
|
|
passwordHash String
|
|
avatar String @default("🐱")
|
|
email String? @unique
|
|
preferences String @default("{}")
|
|
createdAt DateTime @default(now())
|
|
decisions Decision[]
|
|
favorites Favorite[]
|
|
|
|
createdBlindBoxRooms BlindBoxRoom[] @relation("RoomCreator")
|
|
blindBoxMemberships BlindBoxMember[]
|
|
submittedIdeas BlindBoxIdea[] @relation("IdeaSubmitter")
|
|
drawnIdeas BlindBoxIdea[] @relation("IdeaDrawer")
|
|
weekendPlans WeekendPlan[]
|
|
}
|
|
|
|
model Decision {
|
|
id String @id @default(cuid())
|
|
userId String
|
|
roomId String
|
|
restaurantName String
|
|
restaurantData String
|
|
matchType String
|
|
participants Int
|
|
createdAt DateTime @default(now())
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
@@index([userId])
|
|
@@index([roomId])
|
|
}
|
|
|
|
model Favorite {
|
|
id String @id @default(cuid())
|
|
userId String
|
|
restaurantId String @default("")
|
|
restaurantData String
|
|
createdAt DateTime @default(now())
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
@@unique([userId, restaurantId])
|
|
@@index([userId])
|
|
}
|
|
|
|
model BlindBoxRoom {
|
|
id String @id @default(cuid())
|
|
code String @unique
|
|
name String
|
|
creatorId String
|
|
city String?
|
|
lat Float?
|
|
lng Float?
|
|
createdAt DateTime @default(now())
|
|
|
|
creator User @relation("RoomCreator", fields: [creatorId], references: [id])
|
|
members BlindBoxMember[]
|
|
ideas BlindBoxIdea[]
|
|
plans WeekendPlan[]
|
|
}
|
|
|
|
model BlindBoxMember {
|
|
id String @id @default(cuid())
|
|
roomId String
|
|
userId String
|
|
joinedAt DateTime @default(now())
|
|
|
|
room BlindBoxRoom @relation(fields: [roomId], references: [id], onDelete: Cascade)
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
@@unique([roomId, userId])
|
|
}
|
|
|
|
model BlindBoxIdea {
|
|
id String @id @default(uuid())
|
|
roomId String
|
|
userId String
|
|
content String
|
|
status String @default("in_pool")
|
|
drawnById String?
|
|
createdAt DateTime @default(now())
|
|
|
|
category String?
|
|
timeSlot String?
|
|
estimatedMinutes Int?
|
|
outdoor Boolean?
|
|
searchQuery String?
|
|
searchType String?
|
|
|
|
room BlindBoxRoom @relation(fields: [roomId], references: [id], onDelete: Cascade)
|
|
user User @relation("IdeaSubmitter", fields: [userId], references: [id], onDelete: Cascade)
|
|
drawnBy User? @relation("IdeaDrawer", fields: [drawnById], references: [id], onDelete: SetNull)
|
|
|
|
@@index([roomId, status])
|
|
@@index([userId])
|
|
}
|
|
|
|
model WeekendPlan {
|
|
id String @id @default(cuid())
|
|
roomId String
|
|
userId String
|
|
planData String
|
|
status String @default("active")
|
|
createdAt DateTime @default(now())
|
|
|
|
room BlindBoxRoom @relation(fields: [roomId], references: [id], onDelete: Cascade)
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
@@index([roomId])
|
|
}
|