// 内容类型
export type ContentType = 'article' | 'post' | 'activity' | 'comment' | 'review'

// 内容状态类型
export type ContentStatus = 'published' | 'draft' | 'deleted' | 'archived'

// 内容审核状态类型
export type ContentAuditStatus = 'pending' | 'approved' | 'rejected'

// 内容分类类型
export type ContentCategory = 'travel' | 'animal' | 'entertainment' | 'food' | 'sports' | 'study' | 'other'

// 内容基本信息接口
export interface Content {
  id: number
  title: string
  content: string
  contentType: ContentType
  authorId: number
  authorName: string
  publishTime: string
  status: ContentStatus
  viewCount: number
  likeCount: number
  commentCount: number
  shareCount: number
  auditStatus: ContentAuditStatus
  auditRemark?: string
  auditTime?: string
  // 分类信息
  category: ContentCategory
  tags?: string[]
  // 多媒体内容
  images?: string[]
  videos?: string[]
  // 地理位置
  location?: string
  latitude?: number
  longitude?: number
  // 关联信息
  relatedActivityId?: number
  relatedAnimalId?: number
  // 隐私设置
  isPublic: boolean
  allowComments: boolean
  allowSharing: boolean
  // 编辑信息
  lastEditTime?: string
  editCount: number
  // SEO信息
  metaDescription?: string
  metaKeywords?: string[]
}

// 内容查询参数接口
export interface ContentQueryParams {
  page: number
  pageSize: number
  keyword?: string
  status?: ContentStatus
  contentType?: ContentType
  auditStatus?: ContentAuditStatus
  authorId?: number
  category?: ContentCategory
  startTime?: string
  endTime?: string
  sortField?: string
  sortOrder?: 'asc' | 'desc'
  // 高级筛选
  minViews?: number
  minLikes?: number
  minComments?: number
  hasImages?: boolean
  hasVideos?: boolean
  // 地理位置筛选
  location?: string
  radius?: number
}

// 内容统计信息接口
export interface ContentStatistics {
  totalContents: number
  publishedContents: number
  draftContents: number
  deletedContents: number
  totalViews: number
  totalLikes: number
  totalComments: number
  totalShares: number
  averageEngagementRate: number
  contentTypeDistribution: Record<ContentType, number>
  categoryDistribution: Record<ContentCategory, number>
  dailyGrowth: number
  topContents: Content[]
  authorDistribution: {
    totalAuthors: number
    activeAuthors: number
    newAuthorsThisMonth: number
    topAuthors: Array<{
      authorId: number
      authorName: string
      contentCount: number
      totalViews: number
    }>
  }
}

// 内容审核记录接口
export interface ContentAuditRecord {
  id: number
  contentId: number
  contentTitle: string
  auditStatus: ContentAuditStatus
  auditRemark?: string
  auditor: string
  auditTime: string
  previousStatus?: ContentStatus
  // 审核详情
  auditDetails?: {
    contentQuality: number
    complianceScore: number
    safetyCheck: boolean
    spamCheck: boolean
  }
  // 违规信息
  violationType?: string
  violationLevel?: 'minor' | 'major' | 'critical'
  penaltyApplied?: string
}

// 内容举报接口
export interface ContentReport {
  id: number
  contentId: number
  contentTitle: string
  reporterId: number
  reporterName: string
  reportReason: string
  reportTime: string
  reportStatus: 'pending' | 'processing' | 'resolved' | 'dismissed'
  // 举报详情
  reportDetails?: {
    violationType: string
    evidence?: string[]
    additionalComments?: string
  }
  // 处理信息
  handledBy?: string
  handleTime?: string
  handleResult?: string
  penaltyApplied?: string
  // 反馈信息
  reporterNotified: boolean
  feedbackProvided?: string
}

// 内容分类统计接口
export interface ContentCategoryStats {
  category: ContentCategory
  totalContents: number
  publishedContents: number
  averageViews: number
  averageLikes: number
  averageComments: number
  engagementRate: number
  topAuthors: Array<{
    authorId: number
    authorName: string
    contentCount: number
  }>
  popularTags: string[]
  growthTrend: number
}

// 内容作者统计接口
export interface ContentAuthorStats {
  authorId: number
  authorName: string
  totalContents: number
  publishedContents: number
  totalViews: number
  totalLikes: number
  totalComments: number
  averageEngagement: number
  followerCount: number
  joinDate: string
  lastActivity: string
  // 内容质量指标
  contentQualityScore: number
  complianceRate: number
  // 认证信息
  isVerified: boolean
  verificationLevel: number
  // 作者分类分布
  categoryDistribution: Record<ContentCategory, number>
}

// 内容时间统计接口
export interface ContentTimeStats {
  date: string
  contentCount: number
  viewCount: number
  likeCount: number
  commentCount: number
  shareCount: number
  newAuthors: number
  peakHours: number[]
  engagementRate: number
}

// 内容标签统计接口
export interface ContentTagStats {
  tag: string
  usageCount: number
  averageViews: number
  averageLikes: number
  averageComments: number
  relatedTags: string[]
  popularityTrend: number
  // 分类关联
  associatedCategories: ContentCategory[]
  // 作者使用情况
  topAuthors: Array<{
    authorId: number
    authorName: string
    usageCount: number
  }>
}

// 内容推荐参数接口
export interface ContentRecommendationParams {
  userId?: number
  preferredCategories?: ContentCategory[]
  preferredTags?: string[]
  location?: string
  timeRange?: [string, string]
  contentType?: ContentType
  minQualityScore?: number
  excludeViewed?: boolean
  limit?: number
}

// 内容导出参数接口
export interface ContentExportParams {
  format: 'csv' | 'excel' | 'json'
  fields: string[]
  startDate?: string
  endDate?: string
  status?: ContentStatus
  contentType?: ContentType
  category?: ContentCategory
  authorId?: number
}

// 内容审核参数接口
export interface ContentAuditParams {
  contentId: number
  auditStatus: ContentAuditStatus
  auditRemark?: string
  violationType?: string
  violationLevel?: 'minor' | 'major' | 'critical'
  penalty?: string
  notifyAuthor: boolean
}

// 内容批量操作参数接口
export interface ContentBatchOperationParams {
  contentIds: number[]
  operation: 'publish' | 'draft' | 'delete' | 'approve' | 'reject'
  auditRemark?: string
  notifyAuthors: boolean
}

// 内容搜索参数接口
export interface ContentSearchParams {
  query: string
  filters?: {
    contentType?: ContentType
    category?: ContentCategory
    status?: ContentStatus
    authorId?: number
    dateRange?: [string, string]
    minViews?: number
    minLikes?: number
  }
  sortBy?: 'relevance' | 'date' | 'views' | 'likes' | 'comments'
  sortOrder?: 'asc' | 'desc'
  page?: number
  pageSize?: number
}

// 内容分析报告接口
export interface ContentAnalysisReport {
  period: string
  totalContents: number
  totalViews: number
  totalEngagement: number
  averageQualityScore: number
  topPerformingContents: Content[]
  topAuthors: ContentAuthorStats[]
  categoryPerformance: ContentCategoryStats[]
  tagAnalysis: ContentTagStats[]
  timeAnalysis: ContentTimeStats[]
  recommendations: string[]
  // 合规性指标
  complianceRate: number
  auditPassRate: number
  reportResolutionRate: number
  // 增长指标
  growthRate: number
  retentionRate: number
  churnRate: number
}