From f4a946f5e224875a4e97d866f2cbf9b5a437460a Mon Sep 17 00:00:00 2001 From: khy <18814188563@163.com> Date: Thu, 29 Dec 2016 15:15:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=9C=AC=E6=AC=A1=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/gh/common/util/LibaoUtils.java | 12 +++++------ .../com/gh/gamecenter/entity/LibaoEntity.java | 12 ++++++++++- .../libao/Libao3FragmentAdapter.java | 21 ++++++++++--------- .../gh/gamecenter/retrofit/ApiService.java | 3 --- .../gh/gamecenter/retrofit/LibaoService.java | 4 ++++ 5 files changed, 32 insertions(+), 20 deletions(-) diff --git a/app/src/main/java/com/gh/common/util/LibaoUtils.java b/app/src/main/java/com/gh/common/util/LibaoUtils.java index 96d469ca0e..0f0d55a8b3 100644 --- a/app/src/main/java/com/gh/common/util/LibaoUtils.java +++ b/app/src/main/java/com/gh/common/util/LibaoUtils.java @@ -178,16 +178,16 @@ public class LibaoUtils { }).start(); } - public static void postDeleteGift(final Context context, final String giftCode, final PostGiftListener listener) { - postDeleteGift(context, giftCode, true, listener); + public static void deleteGift(final Context context, final String giftCode, final PostLibaoListener listener) { + deleteGift(context, giftCode, true, listener); } - private static void postDeleteGift(final Context context, final String giftCode, final boolean isCheck, final PostGiftListener listener) { + private static void deleteGift(final Context context, final String giftCode, final boolean isCheck, final PostLibaoListener listener) { new Thread(new Runnable() { @Override public void run() { - RetrofitManager.getApi() - .postDeleteGift(TokenUtils.getToken(context, isCheck), giftCode) + RetrofitManager.getLibao() + .deleteGift(TokenUtils.getToken(context, isCheck), giftCode) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Response(){ @@ -203,7 +203,7 @@ public class LibaoUtils { if (e instanceof HttpException) { HttpException exception = (HttpException) e; if (exception.code() == 401) { - postGiftLing(context, giftCode, false, listener); + postLibaoLing(context, giftCode, false, listener); return; } } diff --git a/app/src/main/java/com/gh/gamecenter/entity/LibaoEntity.java b/app/src/main/java/com/gh/gamecenter/entity/LibaoEntity.java index 203dcc4da7..10328951b3 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/LibaoEntity.java +++ b/app/src/main/java/com/gh/gamecenter/entity/LibaoEntity.java @@ -35,6 +35,16 @@ public class LibaoEntity { private String packageName; + private boolean active; + + public boolean isActive() { + return active; + } + + public void setActive(boolean active) { + this.active = active; + } + public LibaoEntity() { } @@ -162,7 +172,7 @@ public class LibaoEntity { libaoEntity.setName(libaoInfo.getName()); libaoEntity.setPlatform(libaoInfo.getPlatform()); libaoEntity.setStatus(libaoInfo.getStatus()); - libaoEntity.setCode(libaoInfo.getStatus()); + libaoEntity.setCode(libaoInfo.getCode()); libaoEntity.setAvailable(libaoInfo.getAvailable()); libaoEntity.setTotal(libaoInfo.getTotal()); return libaoEntity; diff --git a/app/src/main/java/com/gh/gamecenter/libao/Libao3FragmentAdapter.java b/app/src/main/java/com/gh/gamecenter/libao/Libao3FragmentAdapter.java index 39b50793ff..1ef6dcfa01 100644 --- a/app/src/main/java/com/gh/gamecenter/libao/Libao3FragmentAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/libao/Libao3FragmentAdapter.java @@ -15,6 +15,7 @@ import com.gh.common.util.DialogUtils; import com.gh.common.util.DisplayUtils; import com.gh.common.util.LibaoUtils; import com.gh.common.util.PlatformUtils; +import com.gh.common.util.Utils; import com.gh.gamecenter.LibaoDetailActivity; import com.gh.gamecenter.R; import com.gh.gamecenter.adapter.viewholder.LibaoNormalViewHolder; @@ -60,9 +61,9 @@ public class Libao3FragmentAdapter extends RecyclerView.Adapter postLibaoTao(@Header("TOKEN") String token, @Path("libao_id") String libaoId); // 礼包 淘号 + @DELETE("libao/code/{gift_code}") + Observable deleteGift(@Header("TOKEN") String token, @Path("gift_code") String giftId); //删除存号箱的礼包 + }