package com.fly.tour.me.model; import android.content.Context; import android.support.annotation.RestrictTo; import com.fly.tour.api.NewsTypeService; import com.fly.tour.api.RetrofitManager; import com.fly.tour.api.dto.RespDTO; import com.fly.tour.api.http.RxAdapter; import com.fly.tour.api.newstype.entity.NewsType; import com.fly.tour.common.mvp.BaseModel; import com.fly.tour.db.dao.NewsTypeDao; import com.fly.tour.me.contract.NewsTypeAddContract; import javax.inject.Inject; import io.reactivex.Observable; /** * Description:
* Author: mxdl
* Date: 2019/5/24
* Version: V1.0.0
* Update:
*/ public class NewsTypeAddModel extends BaseModel implements NewsTypeAddContract.Model { private NewsTypeService mNewsTypeService; @Inject public NewsTypeAddModel(Context context, NewsTypeDao newsTypeDao) { super(context); mNewsTypeService = RetrofitManager.getInstance().getNewsTypeService(); } @Override public Observable> addNewsType(NewsType type) { return mNewsTypeService.addNewsType(RetrofitManager.getInstance().TOKEN,type) .compose(RxAdapter.>bindUntilEvent(getLifecycle())) .compose(RxAdapter.schedulersTransformer()) .compose(RxAdapter.exceptionTransformer()); } }