/**
 * 支持的平台类型
 */
export type PlatformType = 
  | 'douyin'       // 抖音
  | 'kuaishou'     // 快手
  | 'weixin_video' // 视频号
  | 'xiaohongshu'  // 小红书
  | 'bilibili'     // B站
  | 'toutiao'      // 头条号
  | 'baijiahao'    // 百家号
  | 'qie'          // 企鹅号
  | 'dayuhao';     // 大鱼号

/**
 * 平台账号状态
 */
export type AccountStatus = 'active' | 'expired' | 'disabled';

/**
 * 代理配置
 */
export interface ProxyConfig {
  enabled: boolean;
  type: 'http' | 'https' | 'socks5';
  host: string;
  port: number;
  username?: string;
  password?: string;
}

/**
 * 平台账号信息
 */
export interface PlatformAccount {
  id: number;
  userId: number;
  platform: PlatformType;
  accountName: string;
  accountId: string;
  avatarUrl: string | null;
  fansCount: number;
  worksCount: number;
  status: AccountStatus;
  proxyConfig: ProxyConfig | null;
  groupId: number | null;
  cookieExpireAt: string | null;
  createdAt: string;
  updatedAt: string;
}

/**
 * 账号分组
 */
export interface AccountGroup {
  id: number;
  userId: number;
  name: string;
  description: string | null;
  createdAt: string;
}

/**
 * 创建账号分组请求
 */
export interface CreateAccountGroupRequest {
  name: string;
  description?: string;
}

/**
 * 添加平台账号请求
 */
export interface AddPlatformAccountRequest {
  platform: PlatformType;
  cookieData: string;
  groupId?: number;
  proxyConfig?: ProxyConfig;
}

/**
 * 更新平台账号请求
 */
export interface UpdatePlatformAccountRequest {
  groupId?: number | null;
  proxyConfig?: ProxyConfig | null;
  status?: AccountStatus;
}

/**
 * 二维码登录信息
 */
export interface QRCodeInfo {
  qrcodeUrl: string;
  qrcodeKey: string;
  expireTime: number;
}

/**
 * 登录状态
 */
export type LoginStatus = 'waiting' | 'scanned' | 'confirmed' | 'expired' | 'error';

/**
 * 登录状态检查结果
 */
export interface LoginStatusResult {
  status: LoginStatus;
  message?: string;
  cookies?: string;
  accountInfo?: {
    accountId: string;
    accountName: string;
    avatarUrl: string;
  };
}
