- 新增 Article 数据模型 + 迁移(title/subtitle/body/coverImage/caption) - 后端:公共 /api/articles 查询接口 + 管理端 CRUD/上传/二维码 - 前端:移动端 /article/:id 阅读页(Playfair + 纸张肌理 + 首行缩进) - Admin:新增文章管理三页(列表/表单/二维码)与侧栏入口 - 导入 6 篇点位解说词:朝天宫/七家湾/运渎/打钉巷/绒庄街/熙南里 - Admin 二维码页增加「复制链接(写入 NFC)」按钮 - 落地页步骤文案从扫码改为 NFC 触碰 - Dockerfile + entrypoint 增加 articles 图片回灌 - 修复 deploy-stamp skill 构建轮询卡住(pgrep 模式错误) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
82 lines
2.1 KiB
Plaintext
82 lines
2.1 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
|
|
}
|