# AI日记系统数据库结构 ## _User - **系统字段** - objectId - username - email - emailVerified - authData - password - createdAt - updatedAt - **扩展字段** - nickname - avatar - bio - lastActiveAt - privacySettings ## Diary - **基础字段** - objectId - createdAt - updatedAt - title - content - **关联字段** - author → _User - **功能字段** - mood - tags - isPublic - location(GeoPoint) - weather - aiAnalysis ## ChatMessage - **基础字段** - objectId - createdAt - updatedAt - content - **关联字段** - sender → _User - receiver → _User - diaryRef → Diary - **状态字段** - isRead - messageType - **媒体字段** - attachments[File] ## Dynamic - **基础字段** - objectId - createdAt - updatedAt - content - **关联字段** - creator → _User - refDiary → Diary - **媒体字段** - images[File] - **地理字段** - location(GeoPoint) - **统计字段** - interactionCount ## Interaction - **基础字段** - objectId - createdAt - updatedAt - type - **关联字段** - fromUser → _User - toUser → _User - targetId(Pointer) - **分类字段** - targetType - **内容字段** - content - **状态字段** - status ## ThanksType - **基础字段** - objectId - createdAt - updatedAt - title - **关联字段** - creator → _User - **清单项目** - items[{ content: String category: String stars: Number }] - **展示字段** - themeColor - isShared - **目标字段** - weeklyGoal ## 关系网络 - _User 1→n Diary - _User 1→n ChatMessage - _User 1→n Dynamic - _User 1→n Interaction - _User 1→n ThanksType - Diary 1→n ChatMessage - Diary 1→n Dynamic - Diary 1→n Interaction - Dynamic 1→n Interaction - ThanksType 1→n Interaction