瀏覽代碼

[로그인][Bug] 휴면 해제 API 수정 추가

hyodong.min 7 年之前
父節點
當前提交
81f090a327

+ 2 - 2
app/src/common/java/kr/co/zumo/app/lifeplus/network/api/LifeplusAPIService.java

@@ -130,7 +130,7 @@ public class LifeplusAPIService extends RetrofitService implements LifeplusAPI {
    * @return
    */
   @Override
-  public Single<LifeplusAPIBean> activeMember(RequestBean bean) {
-    return api(AUTH_URL).activeMember(bean);
+  public Single<LifeplusAPIBean> updateUnRestMember(UserNoBean bean) {
+    return api(AUTH_URL).updateUnRestMember(bean);
   }
 }

+ 18 - 16
app/src/main/java/kr/co/zumo/app/lifeplus/model/RestMemberModel.java

@@ -3,7 +3,11 @@
  */
 package kr.co.zumo.app.lifeplus.model;
 
+import io.reactivex.android.schedulers.AndroidSchedulers;
 import io.reactivex.disposables.Disposable;
+import io.reactivex.schedulers.Schedulers;
+import kr.co.zumo.app.lifeplus.bean.api.UserNoBean;
+import kr.co.zumo.app.lifeplus.network.api.LifeplusAPIService;
 import kr.co.zumo.app.lifeplus.view.Event;
 
 /**
@@ -52,21 +56,19 @@ public class RestMemberModel extends Model {
    * 회원 휴면 해제
    */
   public void activeMember() {
-    onResult(new Event.Builder(Event.SUCCESS).build());
-
-//    disposable = new LifeplusAPIService().activeMember(new RequestBean())
-//      .subscribeOn(Schedulers.io())
-//      .observeOn(AndroidSchedulers.mainThread())
-//      .subscribe(resultBean -> {
-//        if (resultBean.isSuccess()) {
-//          SuperModel.getInstance().deleteMemberStatus(SuperModel.MEMBER_STATUS_BIT_REST);
-//          onResult(new Event.Builder(Event.SUCCESS).build());
-//        }
-//        else {
-//          onResult(new Event.Builder(Event.ERROR).string(resultBean.getReturnMessage()).build());
-//        }
-//      }, e -> {
-//        onResult(new Event.Builder(Event.ERROR).string(e.getLocalizedMessage()).build());
-//      });
+    disposable = new LifeplusAPIService().updateUnRestMember(new UserNoBean(SuperModel.getInstance().getUserId()))
+      .subscribeOn(Schedulers.io())
+      .observeOn(AndroidSchedulers.mainThread())
+      .subscribe(resultBean -> {
+        if (resultBean.isSuccess()) {
+          SuperModel.getInstance().deleteMemberStatus(SuperModel.MEMBER_STATUS_BIT_REST);
+          onResult(new Event.Builder(Event.SUCCESS).build());
+        }
+        else {
+          onResult(new Event.Builder(Event.ERROR).string(resultBean.getReturnMessage()).build());
+        }
+      }, e -> {
+        onResult(new Event.Builder(Event.ERROR).string(e.getLocalizedMessage()).build());
+      });
   }
 }

+ 1 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/model/SignUpModel.java

@@ -239,6 +239,7 @@ public class SignUpModel extends Model {
             }
             else if(resultBean.getCode() == LifeplusAPIBean.RETURN_MOBILE_AUTH_ERROR_NEED_FOR_30_DAYS){
               // 탈퇴 30일 회원 구분
+              SuperModel.getInstance().addMemberStatus(SuperModel.MEMBER_STATUS_BIT_OUT);
               onResult(new Event.Builder(Event.RESULT).integer(Event.MEMBER_NEED_30DAYS).build());
             }
             else {

+ 2 - 2
app/src/main/java/kr/co/zumo/app/lifeplus/network/api/LifeplusAPI.java

@@ -54,6 +54,6 @@ public interface LifeplusAPI {
   @POST("api/v1/member/selectMember.plus")
   Single<LoginResultBean> selectMember(@Body UserNoBean bean);
 
-  @POST("api/v1/member/activeMember.plus")
-  Single<LifeplusAPIBean> activeMember(@Body RequestBean bean);
+  @POST("api/v1/member/updateUnRestMember.plus")
+  Single<LifeplusAPIBean> updateUnRestMember(@Body UserNoBean bean);
 }

+ 2 - 2
app/src/main/java/kr/co/zumo/app/lifeplus/network/api/LifeplusAPIRepository.java

@@ -92,9 +92,9 @@ public class LifeplusAPIRepository implements LifeplusAPI {
   }
 
   @Override
-  public Single<LifeplusAPIBean> activeMember(RequestBean bean) {
+  public Single<LifeplusAPIBean> updateUnRestMember(UserNoBean bean) {
     mapBasicParameter(bean);
-    return new LifeplusAPIService().activeMember(bean);
+    return new LifeplusAPIService().updateUnRestMember(bean);
   }
 
 }

+ 2 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/presenter/signup/SignUpMobileAuthPresenter.java

@@ -25,6 +25,7 @@ import kr.co.zumo.app.lifeplus.bean.MobileAuthBean;
 import kr.co.zumo.app.lifeplus.bean.api.LifeplusAPIBean;
 import kr.co.zumo.app.lifeplus.manager.ActionBarManager;
 import kr.co.zumo.app.lifeplus.model.SignUpModel;
+import kr.co.zumo.app.lifeplus.model.SuperModel;
 import kr.co.zumo.app.lifeplus.supervisor.ScreenID;
 import kr.co.zumo.app.lifeplus.util.Formatter;
 import kr.co.zumo.app.lifeplus.util.ResourceUtil;
@@ -191,6 +192,7 @@ public class SignUpMobileAuthPresenter extends SignUpFragmentPresenter {
     }
     else if (resultBean.getCode() == LifeplusAPIBean.RETURN_MOBILE_AUTH_ERROR_NEED_FOR_30_DAYS) {
       // 30일이내 가입
+      SuperModel.getInstance().addMemberStatus(SuperModel.MEMBER_STATUS_BIT_OUT);
       onCommand(new FragmentChangeCommand(ScreenID.SIGN_UP_NEED_FOR_30DAYS, ScreenID.DIRECTION_NEXT));
     }
     else {

+ 1 - 1
app/src/sandbox/java/kr/co/zumo/app/lifeplus/network/api/LifeplusAPIService.java

@@ -206,7 +206,7 @@ public class LifeplusAPIService implements LifeplusAPI {
   }
 
   @Override
-  public Single<LifeplusAPIBean> activeMember(RequestBean bean) {
+  public Single<LifeplusAPIBean> updateUnRestMember(UserNoBean bean) {
     return Single.fromCallable(() -> new LifeplusAPIBean(LifeplusAPIBean.RETURN_SUCCESS, ""));
 //    return Single.fromCallable(() -> new LifeplusAPIBean(LifeplusAPIBean.RETURN_PARAMETER_ERROR, "RETURN_PARAMETER_ERROR"));
   }