# AIBirdDatabaseSchema

## Region
- **属性**
  - objectId: String
  - createdAt: Date
  - updatedAt: Date
  - name: String
  - description: String
  - climate: String
  - terrain: String
  - areaSize: Number
  - bestSeason: String
  - featureTags: Array\<String>
  - centerLocation: GeoPoint
  - mapImage: File
  - popularity: Number
- **关系**
  - 包含多个 `BirdRoute`

## Bird
- **属性**
  - objectId: String
  - createdAt: Date
  - updatedAt: Date
  - name: String
  - scientificName: String
  - family: String
  - description: String
  - habitats: Array\<String>
  - conservationStatus: String
  - seasons: Array\<String>
  - image: File
  - size: String
  - color: String
  - diet: String
- **关系**
  - 被多个 `UserObservation` 观察
  - 出现在多个 `BirdRoute`

## BirdRoute
- **属性**
  - objectId: String
  - createdAt: Date
  - updatedAt: Date
  - name: String
  - description: String
  - region: Pointer\<Region>
  - length: Number
  - difficulty: Number
  - estimatedTime: Number
  - pathPoints: Array\<GeoPoint>
  - commonBirds: Array\<Pointer\<Bird>>
  - bestMonths: Array\<String>
  - startPoint: String
  - endPoint: String
  - rating: Number
  - facilities: Array\<String>
  - routeImage: File
  - popularity: Number
- **关系**
  - 属于一个 `Region`
  - 有多个 `UserObservation`
  - 有多个 `RouteReview`
  - 被多个 `Post` 关联

## UserObservation
- **属性**
  - objectId: String
  - createdAt: Date
  - updatedAt: Date
  - user: Pointer\<User>
  - bird: Pointer\<Bird>
  - route: Pointer\<BirdRoute>
  - observationTime: Date
  - location: GeoPoint
  - weather: String
  - notes: String
  - photo: File
  - confidence: Number
- **关系**
  - 属于一个 `User`
  - 观察一个 `Bird`
  - 在一条 `BirdRoute`

## RouteReview
- **属性**
  - objectId: String
  - createdAt: Date
  - updatedAt: Date
  - user: Pointer\<User>
  - route: Pointer\<BirdRoute>
  - rating: Number
  - comment: String
  - tags: Array\<String>
  - visitDate: Date
  - birdsSeen: Array\<Pointer\<Bird>>
- **关系**
  - 由一个 `User` 撰写
  - 评价一条 `BirdRoute`

## User
- **属性**
  - objectId: String
  - createdAt: Date
  - updatedAt: Date
  - username: String
  - email: String
  - passwordHash: String
  - avatar: File
  - bio: String
  - location: String
  - joinDate: Date
  - interests: Array\<String>
  - observationCount: Number
  - followerCount: Number
  - followingCount: Number
  - isVerified: Boolean
- **关系**
  - 创建多个 `UserObservation`
  - 撰写多个 `RouteReview`
  - 发布多个 `Post`
  - 发表多个 `Comment`
  - 有多个 `Favorite`

## Post
- **属性**
  - objectId: String
  - createdAt: Date
  - updatedAt: Date
  - author: Pointer\<User>
  - title: String
  - content: String
  - images: Array\<File>
  - relatedBird: Pointer\<Bird>
  - relatedRoute: Pointer\<BirdRoute>
  - likes: Array\<Pointer\<User>>
  - comments: Array\<Comment>
  - tags: Array\<String>
  - viewCount: Number
  - isPinned: Boolean
- **关系**
  - 由一个 `User` 创建
  - 关联一个 `Bird` (可选)
  - 关联一条 `BirdRoute` (可选)
  - 有多个 `Comment`
  - 被多个 `User` 点赞

## Comment
- **属性**
  - objectId: String
  - createdAt: Date
  - updatedAt: Date
  - author: Pointer\<User>
  - post: Pointer\<Post>
  - content: String
  - likes: Array\<Pointer\<User>>
  - replyTo: Pointer\<Comment>
- **关系**
  - 由一个 `User` 发表
  - 属于一个 `Post`
  - 回复另一个 `Comment` (可选)
  - 被多个 `User` 点赞

## Favorite
- **属性**
  - objectId: String
  - createdAt: Date
  - updatedAt: Date
  - user: Pointer\<User>
  - bird: Pointer\<Bird>
  - route: Pointer\<BirdRoute>
  - addedAt: Date
- **关系**
  - 属于一个 `User`
  - 收藏一个 `Bird` 或 `BirdRoute`