| | |
| | | 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 |
| | | import cn.flightfeather.thirdappmodule.httpservice.CommonService |
| | | import cn.flightfeather.thirdappmodule.httpservice.DomainItemService |
| | | import cn.flightfeather.thirdappmodule.model.bean.BaseResponse |
| | | import cn.flightfeather.thirdappmodule.model.enumreation.MediaFileType |
| | | import cn.flightfeather.thirdappmodule.repository.dao.MediaTypeAliasDao |
| | | import io.reactivex.schedulers.Schedulers |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * 根据值域类别名称,获取具体的选项 |
| | | */ |
| | | fun getDomainItem(name: String, resultCallBack: ResultCallBack<ArrayList<Domainitem>>) { |
| | | val service = retrofit.create(DomainItemService::class.java).getItemByName(name) |
| | | |
| | | RetrofitFactory.executeResult(service, object : ResultObserver<BaseResponse<ArrayList<Domainitem>>>() { |
| | | override fun onSuccess(result: BaseResponse<ArrayList<Domainitem>>?) { |
| | | resultCallBack.onSuccess(result?.data) |
| | | } |
| | | |
| | | override fun onFailure(e: Throwable, isNetWorkError: Boolean) { |
| | | resultCallBack.onFailure() |
| | | } |
| | | }) |
| | | } |
| | | } |