from typing import Dict, Any
from .base import BaseMixin
from ..const import API_PATHS


class User(BaseMixin):
    async def info(self) -> Dict[str, Any]:
        """
        获取用户信息
        
        获取当前用户的详细信息，包括用户ID、用户名、存储空间使用情况等。
        
        注意：此接口有访问频率限制(QPS: 10)。
        
        Returns:
            Dict[str, Any]: API响应数据
            
        Returns Data Structure:
            {
                "code": 0,
                "message": "ok",
                "data": {
                    "userID": 12345,
                    "username": "用户名",
                    "nickname": "昵称",
                    "avatar": "头像URL",
                    "email": "email@example.com",
                    "phone": "13800138000",
                    "vipExpire": "2024-12-31 23:59:59",
                    "storage": {
                        "total": 1099511627776,
                        "used": 107374182400
                    }
                }
            }
        
        字段说明:
            userID: 用户ID
            username: 用户名
            nickname: 昵称
            avatar: 头像URL
            email: 邮箱
            phone: 手机号
            vipExpire: VIP过期时间
            storage: 存储空间信息
                total: 总空间(字节)
                used: 已用空间(字节)
        
        Example:
            >>> result = await user.info()
            >>> user_data = result["data"]
            >>> print(f"用户名: {user_data['username']}")
            >>> storage = user_data['storage']
            >>> used_gb = storage['used'] / (1024**3)
            >>> total_gb = storage['total'] / (1024**3)
            >>> print(f"存储使用: {used_gb:.2f}GB / {total_gb:.2f}GB")
        """
        return await self._send_request(
            API_PATHS.user_info
        )
