|
|
@@ -35,11 +35,6 @@ import kr.co.zumo.app.lifeplus.view.Event;
|
|
|
*/
|
|
|
public class SignUpModel extends Model {
|
|
|
|
|
|
- public static final int EVENT_BANNER = 824;
|
|
|
- public static final int EVENT_POLICY_REQUEST = 346;
|
|
|
- public static final int EVENT_POLICY_CONFIRM = 347;
|
|
|
- public static final int EVENT_JOINED = 735;
|
|
|
-
|
|
|
protected CompositeDisposable disposable = new CompositeDisposable();
|
|
|
|
|
|
protected ArrayList<PolicyBean> agreeItems;
|
|
|
@@ -135,7 +130,7 @@ public class SignUpModel extends Model {
|
|
|
bannerItems.add(new BannerBean(1, ResourceUtil.getString(R.string.sign_up_benefit2), ResourceUtil.getString(R.string.sign_up_benefit2_detail)));
|
|
|
bannerItems.add(new BannerBean(2, ResourceUtil.getString(R.string.sign_up_benefit3), ResourceUtil.getString(R.string.sign_up_benefit3_detail)));
|
|
|
|
|
|
- onResult(new Event.Builder(Event.RESULT).integer(EVENT_BANNER).build());
|
|
|
+ onResult(new Event.Builder(Event.RESULT).integer(Event.BANNER_REQUEST).build());
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -166,10 +161,10 @@ public class SignUpModel extends Model {
|
|
|
Log.i("APP# SignUpModel | requestPolicy", "|" + resultBean.toPrettyJson());
|
|
|
if (resultBean.isSuccess()) {
|
|
|
agreeItems = resultBean.getData();
|
|
|
- onResult(new Event.Builder(Event.RESULT).integer(EVENT_POLICY_REQUEST).build());
|
|
|
+ onResult(new Event.Builder(Event.RESULT).integer(Event.POLICY_REQUEST).build());
|
|
|
}
|
|
|
}, e -> {
|
|
|
- onError(new Event.Builder(Event.ERROR).integer(EVENT_POLICY_REQUEST).string(e.getLocalizedMessage()).build(), e);
|
|
|
+ onResult(new Event.Builder(Event.ERROR).integer(Event.POLICY_REQUEST).string(e.getLocalizedMessage()).build());
|
|
|
})
|
|
|
);
|
|
|
}
|
|
|
@@ -235,9 +230,9 @@ public class SignUpModel extends Model {
|
|
|
.subscribe(resultBean -> {
|
|
|
Log.i("APP# SignUpModel | signUp", "|" + resultBean.toPrettyJson());
|
|
|
saveUserId(resultBean.getData().getUserNo());
|
|
|
- onResult(new Event.Builder(Event.RESULT).integer(EVENT_JOINED).build());
|
|
|
+ onResult(new Event.Builder(Event.RESULT).integer(Event.MEMBER_JOIN).build());
|
|
|
}, e -> {
|
|
|
- onError(new Event.Builder(Event.ERROR).integer(EVENT_JOINED).string(e.getLocalizedMessage()).build(), e);
|
|
|
+ onResult(new Event.Builder(Event.ERROR).integer(Event.MEMBER_JOIN).string(e.getLocalizedMessage()).build());
|
|
|
})
|
|
|
);
|
|
|
}
|
|
|
@@ -285,9 +280,9 @@ public class SignUpModel extends Model {
|
|
|
.subscribeOn(Schedulers.io())
|
|
|
.observeOn(AndroidSchedulers.mainThread())
|
|
|
.subscribe(resultBean -> {
|
|
|
- onResult(new Event.Builder(Event.RESULT).integer(EVENT_POLICY_CONFIRM).build());
|
|
|
+ onResult(new Event.Builder(Event.RESULT).integer(Event.POLICY_CONFIRM).build());
|
|
|
}, e -> {
|
|
|
- onError(new Event.Builder(Event.ERROR).integer(EVENT_POLICY_CONFIRM).string(e.getLocalizedMessage()).build(), e);
|
|
|
+ onResult(new Event.Builder(Event.ERROR).integer(Event.POLICY_CONFIRM).string(e.getLocalizedMessage()).build());
|
|
|
})
|
|
|
);
|
|
|
}
|