NERoom SDK V1.36.0
载入中...
搜索中...
未找到
auth_service_interface.h
浏览该文件的文档.
1// Copyright (c) 2022 NetEase, Inc. All rights reserved.
2// Use of this source code is governed by a MIT license that can be
3// found in the LICENSE file.
4
11#ifndef AUTH_SERVICE_INTERFACE_H
12#define AUTH_SERVICE_INTERFACE_H
13
15#include "base_type_defines.h"
16#include "error_code_defines.h"
17
18namespace neroom {
19
31
32class INEAuthListener;
33
38public:
43
44public:
48 INEAuthService() = default;
49
53 virtual ~INEAuthService() = default;
54
62 virtual void login(const std::string& account, const std::string& token, const NEAuthCallback& callback) = 0;
70 virtual void loginByDynamicToken(const std::string& account, const std::string& token, std::string& authType, const NEAuthCallback& callback) = 0;
71
77 virtual void logout(const NEAuthCallback& callback) = 0;
78
83 virtual bool isLoggedIn() = 0;
84
90 virtual void addAuthListener(INEAuthListener* listener) = 0;
91
97 virtual void removeAuthListener(INEAuthListener* listener) = 0;
98};
99
106public:
110 INEAuthListener() = default;
111
115 virtual ~INEAuthListener() = default;
116
122 virtual void onAuthEvent(NEAuthEvent authEvent) { (void)authEvent; };
123};
124
125} // namespace neroom
126
127#endif // AUTH_SERVICE_INTERFACE_H
基础服务接口头文件
基本类型定义头文件
登录状态等事件监听
virtual ~INEAuthListener()=default
析构函数
INEAuthListener()=default
构造函数
virtual void onAuthEvent(NEAuthEvent authEvent)
登录状态
virtual void removeAuthListener(INEAuthListener *listener)=0
移除鉴权事件监听
virtual void logout(const NEAuthCallback &callback)=0
退出登录
virtual void loginByDynamicToken(const std::string &account, const std::string &token, std::string &authType, const NEAuthCallback &callback)=0
INEAuthService()=default
构造函数
virtual void login(const std::string &account, const std::string &token, const NEAuthCallback &callback)=0
实名登录
virtual ~INEAuthService()=default
析构函数
virtual void addAuthListener(INEAuthListener *listener)=0
添加鉴权事件监听
virtual bool isLoggedIn()=0
查询当前登录状态
NECallback<> NEAuthCallback
账户操作结果回调
错误码定义头文件
std::function< void(int, const std::string &, const TResultParam &...)> NECallback
通用回调
enum neroom::tagNEAuthEvent NEAuthEvent
登录状态
tagNEAuthEvent
登录状态