1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
| package cn.flightfeather.thirdappmodule.common.net
|
| /**
| * @author riku
| * Date: 2019/4/24
| * 数据获取结果回调
| * MVVM模式中,数据仓库(repository)管理所有的数据获取具体实现,提供此接口来实现数据获取各步骤中的方法回调
| */
| interface ResultCallBack<T> {
|
| /**
| * 分页信息获取
| * @param current 当前页码(最小为1)
| * @param total 总页数
| */
| fun onPage(current: Int, total: Int) = Unit
|
| fun onSuccess(result: T?)
|
| fun onCacheSuccess(result: T?) = Unit
|
| fun onFailure()
|
| }
|
|