feat: 支持微信用户列表展示
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user