# AI智能食谱推荐助手数据库结构

## 用户模块
- User
  - username: String
  - password: String
  - email: String
  - avatar: Parse.File
  - → 收藏(UserFavorite)
  - → 浏览历史(UserHistory)
  - → AI对话(AIConversation)

## 食谱分类
- DishCategory
  - categoryName: String
  - description: String
  - coverImage: Parse.File
  - → 包含食谱(Recipe 1:N)

## 食谱核心
- Recipe
  - recipeName: String
  - ingredients: [String]
  - steps: [String]
  - cookingTime: Number
  - calorie: Number
  - coverImage: Parse.File
  - tags: [String]
  - ← 所属分类(DishCategory)
  - → 收藏记录(UserFavorite)
  - → 浏览历史(UserHistory)

## 用户行为
- UserFavorite
  - user: → User
  - recipe: → Recipe

- UserHistory
  - user: → User
  - recipe: → Recipe
  - viewTime: Date

## 推荐系统
- DailyRecommendation
  - recommendDate: Date
  - recipes: [→ Recipe] (3个)
  - recommendType: String (热门/个性化)

## AI对话系统
- NutritionExpert
  - expertName: String
  - specialty: String
  - description: String
  - avatar: Parse.File

- AIConversation
  - chatHistory: [Object]
  - lastActive: Date
  - user: → User
  - expert: → NutritionExpert

## 系统字段
- 通用字段
  - objectId: String (主键)
  - createdAt: Date
  - updatedAt: Date

## 关系说明
- 1:N关系
  - 用户 ↔ 收藏/历史
  - 分类 ↔ 食谱
- M:N关系
  - 推荐 ↔ 食谱
- 对话系统
  - 用户 ↔ 专家 ↔ 对话记录