// 用户状态枚举
export enum UserStatus {
  Normal = 0,
  Disabled = 1
}

// 设备状态枚举
export enum DeviceStatus {
  Normal = 0,
  Disabled = 1
}

// 可见性类型枚举
export enum VisibilityType {
  Public = 0,
  Private = 1,
  Specified = 2
}

// 管理员角色枚举
export enum AdminRole {
  User = 0,
  Admin = 1,
  SuperAdmin = 2
}

// API 响应
export interface ApiResponse<T = any> {
  success: boolean
  message?: string
  data?: T
  errorCode?: string
}

// 分页结果
export interface PagedResult<T> {
  items: T[]
  total: number
  page: number
  pageSize: number
  totalPages: number
  hasNextPage: boolean
  hasPreviousPage: boolean
}

// 用户信息
export interface User {
  id: string
  email: string
  userName: string
  avatar?: string
  role: AdminRole
  createdAt: string
  lastLoginAt?: string
}

// 设备信息
export interface Device {
  id: string
  deviceName: string
  deviceType: string
  isAdmin: boolean
  createdAt: string
  lastActiveAt: string
  status: DeviceStatus
}

// 书签信息
export interface Bookmark {
  id: string
  title: string
  url: string
  description?: string
  icon?: string
  tags: string[]
  visitCount: number
  lastVisitTime?: string
  order: number
  visibility: VisibilityType
  allowedDevices?: string[]
  createdAt: string
  updatedAt: string
}

// 管理员用户
export interface AdminUser {
  id: string
  email: string
  userName: string
  avatar?: string
  role: AdminRole
  status: UserStatus
  createdAt: string
  lastLoginAt?: string
  deviceCount: number
  bookmarkCount: number
}

// 管理员用户详情
export interface AdminUserDetail extends AdminUser {
  devices: Device[]
}

// 系统统计
export interface AdminStatistics {
  totalUsers: number
  activeUsersLast7Days: number
  newUsersToday: number
  newUsersThisWeek: number
  newUsersThisMonth: number
  totalBookmarks: number
  totalDevices: number
  disabledUsers: number
}

// 认证响应
export interface AuthResponse {
  success: boolean
  message?: string
  accessToken?: string
  refreshToken?: string
  expiresAt?: string
  user?: User
  device?: Device
}

