"""
用户认证服务使用示例
"""
from backend.services.auth_service import AuthService

def main():
    auth = AuthService()
    print("=== 注册用户 ===")
    res = auth.register_user("test_user2", "test_password")
    print(res)

    print("=== 登录用户 ===")
    res = auth.login_user("test_user2", "test_password")
    print(res)
    token = res.get("token")
    user = res.get("user")
    user_id = user["id"] if user else None

    print("=== 获取用户信息 ===")
    res = auth.get_user_info(user_id)
    print(res)

    print("=== 更新用户信息 ===")
    res = auth.update_user_info(user_id, is_active=False)
    print(res)

    print("=== 退出登录 ===")
    res = auth.logout_user(token)
    print(res)

    print("=== 删除用户 ===")
    res = auth.delete_user(user_id)
    print(res)

if __name__ == "__main__":
    main() 