fix apiservice
This commit is contained in:
@ -42,8 +42,6 @@ import rx.Observable;
|
||||
import rx.android.schedulers.AndroidSchedulers;
|
||||
import rx.schedulers.Schedulers;
|
||||
|
||||
import static com.gh.gamecenter.retrofit.RetrofitManager.getLibao;
|
||||
|
||||
/**
|
||||
* Created by khy on 2016/12/16.
|
||||
* 礼包工具类, 包括联网操作和领取按钮状态
|
||||
@ -74,7 +72,7 @@ public class LibaoUtils {
|
||||
|
||||
//初始化存号箱 获取存号箱所有礼包
|
||||
public static void getCunHaoXiang(final Context context) {
|
||||
getLibao()
|
||||
RetrofitManager.getInstance(context).getApi()
|
||||
.getCunHaoXiang(LoginUtils.getToken(context))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
@ -111,9 +109,9 @@ public class LibaoUtils {
|
||||
|
||||
Observable<ResponseBody> observable;
|
||||
if (!TextUtils.isEmpty(captchaCode)) {
|
||||
observable = getLibao().postLibaoLing(LoginUtils.getToken(context), captchaCode, libaoId);
|
||||
observable = RetrofitManager.getInstance(context).getApi().postLibaoLing(LoginUtils.getToken(context), captchaCode, libaoId);
|
||||
} else {
|
||||
observable = RetrofitManager.getLibao().postLibaoLing(LoginUtils.getToken(context), libaoId);
|
||||
observable = RetrofitManager.getInstance(context).getApi().postLibaoLing(LoginUtils.getToken(context), libaoId);
|
||||
}
|
||||
observable.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
@ -135,7 +133,7 @@ public class LibaoUtils {
|
||||
|
||||
private static void postLibaoTao(final Context context, final String libaoId, final boolean isCheck,
|
||||
final PostLibaoListener listener) {
|
||||
getLibao().postLibaoTao(LoginUtils.getToken(context), libaoId)
|
||||
RetrofitManager.getInstance(context).getApi().postLibaoTao(LoginUtils.getToken(context), libaoId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new JSONObjectResponse() {
|
||||
@ -153,7 +151,7 @@ public class LibaoUtils {
|
||||
|
||||
public static void deleteLibaoCode(final Context context, final String code, final boolean isCheck,
|
||||
final PostLibaoListener listener) {
|
||||
getLibao().deleteLibaoCode(LoginUtils.getToken(context), code)
|
||||
RetrofitManager.getInstance(context).getApi().deleteLibaoCode(LoginUtils.getToken(context), code)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Response<ResponseBody>() {
|
||||
@ -169,8 +167,8 @@ public class LibaoUtils {
|
||||
});
|
||||
}
|
||||
|
||||
public static void getLibaoStatus(String ids, final PostLibaoListener listener) {
|
||||
getLibao().getLibaoStatus(ids)
|
||||
public static void getLibaoStatus(Context context, String ids, final PostLibaoListener listener) {
|
||||
RetrofitManager.getInstance(context).getApi().getLibaoStatus(ids)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Response<List<LibaoStatusEntity>>() {
|
||||
|
||||
Reference in New Issue
Block a user