- 新增 Music 数据模型 + 迁移(title/subtitle/audioFile) - 后端:公共 /api/music 查询接口 + 管理端 CRUD (音频上传专用 multer,限制 20MB) - 移动端 /music/:id 播放页: - 金色印章式唱片 + 旋转虚线环 + 三重金色涟漪 - preload=auto + HTTP Range 流式加载 - 浏览器禁止 autoplay 时显示「轻点聆听」overlay - 自定义进度条与时间显示 - Admin:新增音乐管理三页(列表/表单/二维码)与侧栏入口 - 导入示例音乐:朝天宫之歌 - Dockerfile + entrypoint 增加 music 资产回灌 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
93 lines
2.4 KiB
Plaintext
93 lines
2.4 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
binaryTargets = ["native", "linux-musl-openssl-3.0.x"]
|
|
}
|
|
|
|
datasource db {
|
|
provider = "sqlite"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(uuid())
|
|
username String @unique
|
|
phone String @unique
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
collections Collection[]
|
|
redemptions Redemption[]
|
|
}
|
|
|
|
model Stamp {
|
|
id String @id @default(uuid())
|
|
name String
|
|
note String?
|
|
imageColor String
|
|
imageGrey String
|
|
sortOrder Int @default(0)
|
|
enabled Boolean @default(true)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
collections Collection[]
|
|
}
|
|
|
|
model Collection {
|
|
id String @id @default(uuid())
|
|
userId String
|
|
stampId String
|
|
collectedAt DateTime @default(now())
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
stamp Stamp @relation(fields: [stampId], references: [id], onDelete: Cascade)
|
|
|
|
@@unique([userId, stampId])
|
|
@@index([userId])
|
|
}
|
|
|
|
model RedemptionRule {
|
|
id String @id @default(uuid())
|
|
name String
|
|
description String?
|
|
threshold Int
|
|
enabled Boolean @default(true)
|
|
sortOrder Int @default(0)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
redemptions Redemption[]
|
|
}
|
|
|
|
model Redemption {
|
|
id String @id @default(uuid())
|
|
userId String
|
|
ruleId String
|
|
stampCount Int
|
|
redeemedAt DateTime @default(now())
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
rule RedemptionRule @relation(fields: [ruleId], references: [id])
|
|
|
|
@@index([userId])
|
|
}
|
|
|
|
model Article {
|
|
id String @id @default(uuid())
|
|
title String
|
|
subtitle String?
|
|
body String
|
|
coverImage String @default("")
|
|
caption String?
|
|
sortOrder Int @default(0)
|
|
enabled Boolean @default(true)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
model Music {
|
|
id String @id @default(uuid())
|
|
title String
|
|
subtitle String?
|
|
audioFile String @default("")
|
|
sortOrder Int @default(0)
|
|
enabled Boolean @default(true)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|