/**
 * API 路径管理
 * 统一管理所有接口路径
 * 
 */
export class ApiPath {
  private constructor() {}

  // API 基础路径
  private static readonly _baseUrl = "/api";

  // ============ 功能模块分组 ============
  private static readonly _auth = `${ApiPath._baseUrl}/auth`;
  private static readonly _user = `${ApiPath._baseUrl}/user`;
  private static readonly _payment = `${ApiPath._baseUrl}/payment`;
  private static readonly _chat = `${ApiPath._baseUrl}/chat`;
  private static readonly _privateRoom = `${ApiPath._baseUrl}/private-room`;

  // ============ 认证相关 ============
  /** 邮箱密码登录 */
  static readonly emailLogin = `${ApiPath._auth}/login`;

  /** 注册 */
  static readonly register = `${ApiPath._auth}/register`;

  /** 设备自动登录 */
  static readonly guestLogin = `${ApiPath._auth}/guest`;

  /** Google 登录 */
  static readonly googleLogin = `${ApiPath._auth}/login/google`;

  /** Facebook 登录 */
  static readonly facebookLogin = `${ApiPath._auth}/login/facebook`;

  /** Facebook ID 登录（v7.0 新增） */
  static readonly facebookIdLogin = `${ApiPath._auth}/login/facebook/by-id`;

  /** 刷新 Token */
  static readonly refresh = `${ApiPath._auth}/refresh`;

  /** 退出登录 */
  static readonly logout = `${ApiPath._auth}/logout`;

  /** 获取当前用户信息 */
  static readonly getCurrentUser = `${ApiPath._auth}/me`;

  // ============ 用户相关 ============
  /** 获取个人信息（与 /auth/me 等价） */
  static readonly userProfile = `${ApiPath._user}/profile`;

  /** 获取当前用户权益快照 */
  static readonly userEntitlements = `${ApiPath._user}/entitlements`;

  // ============ 支付相关 ============
  /** 创建充值订单 */
  static readonly paymentCreateOrder = `${ApiPath._payment}/create-order`;

  /** 查询订单状态 */
  static readonly paymentOrderStatus = `${ApiPath._payment}/order-status`;

  /** 获取商品套餐列表 */
  static readonly paymentPlans = `${ApiPath._payment}/plans`;

  // ============ 聊天相关 ============
  /** 发送消息 */
  static readonly chatSend = `${ApiPath._chat}/send`;

  /** 获取聊天历史 */
  static readonly chatHistory = `${ApiPath._chat}/history`;

  /** 解锁私密消息 */
  static readonly chatUnlockPrivate = `${ApiPath._chat}/unlock-private`;

  /** 一键解锁历史锁定消息 */
  static readonly chatUnlockHistory = `${ApiPath._chat}/unlock-history`;

  // ============ 私密空间相关 ============
  /** 获取私密空间动态列表 */
  static readonly privateRoomMoments = `${ApiPath._privateRoom}/moments`;

  /** 解锁私密空间动态 */
  static privateRoomMomentUnlock(momentId: string): string {
    return `${ApiPath.privateRoomMoments}/${encodeURIComponent(momentId)}/unlock`;
  }

  // ============ 数据看板相关 ============
  private static readonly _metrics = `${ApiPath._baseUrl}/metrics`;

  /** 上报 PWA 事件 */
  static readonly metricsPwaEvent = `${ApiPath._metrics}/pwa/event`;

  // ============ 数据上报相关（v7.0 新增） ============
  private static readonly _data = `${ApiPath._baseUrl}/data`;

  /** 上报用户信息 */
  static readonly reportUserInfo = `${ApiPath._data}/report-user-info`;
}
