feat: 支持微信用户列表展示

This commit is contained in:
richarjiang
2026-04-05 20:19:08 +08:00
parent 7bce04a163
commit f8f6f17bd4
8 changed files with 508 additions and 1 deletions

View File

@@ -22,6 +22,8 @@ model Level {
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
userProgress WxUserLevelProgress[]
@@map("levels")
}
@@ -85,3 +87,30 @@ model Verification {
@@map("verifications")
}
model WxUser {
id String @id @default(uuid())
openid String @unique
sessionKey String? @map("session_key")
nickname String?
avatarUrl String? @map("avatar_url")
points Int @default(10)
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
levelProgress WxUserLevelProgress[]
@@map("wx_users")
}
model WxUserLevelProgress {
id String @id @default(uuid())
userId String @map("user_id")
levelId String @map("level_id")
completedAt DateTime @default(now()) @map("completed_at")
user WxUser @relation(fields: [userId], references: [id], onDelete: Cascade)
level Level @relation(fields: [levelId], references: [id])
@@map("wx_user_level_progress")
}