diff --git a/common/src/main/java/com/yunbao/common/http/main/MainNetManager.java b/common/src/main/java/com/yunbao/common/http/main/MainNetManager.java index c1be0e2bb..b6054bdfb 100644 --- a/common/src/main/java/com/yunbao/common/http/main/MainNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/main/MainNetManager.java @@ -110,4 +110,52 @@ public class MainNetManager { } }).isDisposed(); } + + /** + * 搜索 + * + * @param jianKey 簡體關鍵字 + * @param fanKey 繁體關鍵字 + * @param type 搜索類型 1,全部 2,主播 3,用戶 + * @param p 頁碼 + */ + public void search(String jianKey, String fanKey, int type, int p, HttpCallback>> callback) { + API.get().pdLiveApi(mContext).search(jianKey,fanKey,type,p) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(listResponseModel -> { + if (callback != null) { + List> model = listResponseModel.getData().getInfo(); + callback.onSuccess(model); + } + }, throwable -> { + if (callback != null) { + callback.onError(throwable.getMessage()); + } + }).isDisposed(); + } + /** + * 搜索 + * + * @param jianKey 簡體關鍵字 + * @param fanKey 繁體關鍵字 + * @param type 搜索類型 1,全部 2,主播 3,用戶 + * @param p 頁碼 + */ + public void searchNew(String jianKey, String fanKey, int type, int p, HttpCallback> callback) { + API.get().pdLiveApi(mContext).searchNew(jianKey,fanKey,type,p) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(listResponseModel -> { + if (callback != null) { + List model = listResponseModel.getData().getInfo(); + callback.onSuccess(model); + } + }, throwable -> { + if (callback != null) { + callback.onError(throwable.getMessage()); + } + }).isDisposed(); + } + }