From f0c4dd1146a90987a7b11e0002bccdef0480937c Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Mon, 8 Aug 2022 10:44:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E4=BB=A3=E7=A0=81=E4=B8=A2=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/http/main/MainNetManager.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) 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(); + } + }