语音聊天室 UIKit API
简介
此模块定义了跨平台通用的基础类型,为 API 调用提供统一的错误处理和回调机制。
功能特性
回调机制:提供统一的完成回调闭包类型。
数据结构
CompletionHandler
提供基础类型定义,包括错误处理结构、回调闭包类型和响应式状态管理工具。
方法
onSuccess: 操作成功时调用。
fun onSuccess()
onFailure: 操作失败时调用。
fun onFailure(code: Int, desc: String)
参数名 | 类型 | 说明 |
code | Int | 错误码。 |
desc | String | 错误描述。 |
ListResultCompletionHandler
列表结果完成回调接口。
用于返回分页列表的异步操作结果回调接口。
方法
onSuccess: 操作成功时调用,返回列表结果和游标。
fun onSuccess(result: List<T>,cursor: String)
参数名 | 类型 | 说明 |
result | List<T> | 结果列表。 |
cursor | String | 分页游标。 |
onFailure: 操作失败时调用。
fun onFailure(code: Int,desc: String)
参数名 | 类型 | 说明 |
code | Int | 错误码。 |
desc | String | 错误描述。 |