| | |
| | | package cn.flightfeather.thirdappmodule.repository |
| | | |
| | | import cn.flightfeather.thirdappmodule.bean.entity.Domainitem |
| | | import cn.flightfeather.thirdappmodule.common.net.ResultCallBack |
| | | import cn.flightfeather.thirdappmodule.common.net.ResultObserver |
| | | import cn.flightfeather.thirdappmodule.common.net.RetrofitFactory |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * 根据值域类别名称,获取具体的选项 |
| | | */ |
| | | fun getDomainItem(name: String, resultCallBack: ResultCallBack<ArrayList<Domainitem>>) { |
| | | val service = retrofit.create(DomainItemService::class.java).getItemByName(name) |
| | | |
| | | RetrofitFactory.executeResult(service, object : ResultObserver<ArrayList<Domainitem>>() { |
| | | override fun onSuccess(result: ArrayList<Domainitem>?) { |
| | | resultCallBack.onSuccess(result) |
| | | } |
| | | |
| | | override fun onFailure(e: Throwable, isNetWorkError: Boolean) { |
| | | resultCallBack.onFailure() |
| | | } |
| | | }) |
| | | } |
| | | } |