package com.quansu.heifengwuliu.repository

import com.quansu.heifengwuliu.utils.net.NetEngine
import com.quansu.heifengwuliu.utils.net.Response
import com.ysnows.base.base.BRepository
import io.reactivex.Observable

class SearchRepository : BRepository() {

    fun addTodo(kw: String): Observable<Response<Any>> {
        return Observable.create { emitter ->
            req(NetEngine.service.addTodo(kw))
                    .doOnNext() {
                        toast(it.msg())
                        emitter.onNext(it)
                    }
                    .subscribe()
        }
    }


}