|
|
@@ -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());
|
|
|
+ });
|
|
|
}
|
|
|
}
|