package cn.flightfeather.thirdappmodule.common.net
|
|
/**
|
* @author riku
|
* Date: 2019/4/24
|
* 数据获取结果回调
|
* MVVM模式中,数据仓库(repository)管理所有的数据获取具体实现,提供此接口来实现数据获取各步骤中的方法回调
|
*/
|
interface ResultCallBack2<T> {
|
|
/**
|
* 分页信息获取
|
* @param current 当前页码(最小为1)
|
* @param total 总页数
|
*/
|
fun onPage(current: Int, total: Int) = Unit
|
|
fun onSuccess(result: T?, message: String)
|
|
fun onCacheSuccess(result: T?) = Unit
|
|
fun onFailure(message:String)
|
|
}
|