|
|
@@ -15,7 +15,6 @@ import kr.co.zumo.app.lifeplus.bean.api.UserNoBean;
|
|
|
import kr.co.zumo.app.lifeplus.model.LifeplusPreferences;
|
|
|
import kr.co.zumo.app.lifeplus.model.SuperModel;
|
|
|
import kr.co.zumo.app.lifeplus.network.api.LifeplusAPIRepository;
|
|
|
-import kr.co.zumo.app.lifeplus.util.AppUtil;
|
|
|
import kr.co.zumo.app.lifeplus.util.StringUtil;
|
|
|
import kr.co.zumo.app.lifeplus.view.Event;
|
|
|
import kr.co.zumo.app.lifeplus.view.dialog.AlertDialog;
|
|
|
@@ -52,8 +51,6 @@ public class ActivityStarter {
|
|
|
Log.i("APP# SplashActivity | onCreate", "| Network Connected ==============================================================> " + isConnected);
|
|
|
LifeplusPreferences preferences = SuperModel.getInstance().getPreferences();
|
|
|
|
|
|
- setDeviceId(AppUtil.getDeviceId(context));
|
|
|
-
|
|
|
Intent intent = null;
|
|
|
if (isConnected == false) {
|
|
|
intent = new Intent(context, NetworkErrorActivity.class);
|
|
|
@@ -95,40 +92,43 @@ public class ActivityStarter {
|
|
|
gotoScreen(MainActivity.class);
|
|
|
}
|
|
|
else {
|
|
|
+
|
|
|
if (loginBean.getBlockStatus().equals(LoginBean.LOCK_STATUS_BLOCK)) {
|
|
|
// 블럭 계정
|
|
|
SuperModel.getInstance().addMemberStatus(SuperModel.MEMBER_STATUS_BIT_BLOCK);
|
|
|
}
|
|
|
|
|
|
- if (loginBean.getMemberStatus().equals(LoginBean.USER_STATUS_OUT)) {
|
|
|
- // 탈퇴 계정
|
|
|
- SuperModel.getInstance().addMemberStatus(SuperModel.MEMBER_STATUS_BIT_OUT);
|
|
|
- }
|
|
|
-
|
|
|
if (loginBean.getMemberStatus().equals(LoginBean.USER_STATUS_REST)) {
|
|
|
// 휴면 계정
|
|
|
SuperModel.getInstance().addMemberStatus(SuperModel.MEMBER_STATUS_BIT_REST);
|
|
|
}
|
|
|
|
|
|
- if (SuperModel.getInstance().isBlockMember()) {
|
|
|
- gotoScreen(BlockMemberActivity.class);
|
|
|
-
|
|
|
- }
|
|
|
- else if (SuperModel.getInstance().isRestMember()) {
|
|
|
- gotoScreen(RestMemberActivity.class);
|
|
|
- }
|
|
|
- else if (SuperModel.getInstance().isOutMember()) {
|
|
|
- showErrorPopup("탈퇴한 회원입니다.");
|
|
|
- }
|
|
|
- else {
|
|
|
- // data 이상
|
|
|
- showErrorPopup("login error - " + loginBean.toJson());
|
|
|
+ if (loginBean.getMemberStatus().equals(LoginBean.USER_STATUS_OUT)) {
|
|
|
+ // 탈퇴 계정
|
|
|
+ SuperModel.getInstance().addMemberStatus(SuperModel.MEMBER_STATUS_BIT_OUT);
|
|
|
}
|
|
|
+
|
|
|
+ onLogin(loginBean.toJson());
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- // 서버와 통신 완료 후 에러 리턴
|
|
|
- showErrorPopup("login error - " + loginResultBean.getReturnMessage());
|
|
|
+ // fixme 서버 연동 포멧이 틀려서 임시로 처리 중 -------------
|
|
|
+ if (loginResultBean.getCode() == -100) {
|
|
|
+ // 블럭 계정
|
|
|
+ SuperModel.getInstance().addMemberStatus(SuperModel.MEMBER_STATUS_BIT_BLOCK);
|
|
|
+ onLogin("");
|
|
|
+ }
|
|
|
+ else if (loginResultBean.getCode() == -200) {
|
|
|
+ // 휴면 계정
|
|
|
+ SuperModel.getInstance().addMemberStatus(SuperModel.MEMBER_STATUS_BIT_REST);
|
|
|
+ onLogin("");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ // fixme 서버 연동 포멧이 틀려서 임시로 처리 중 -------------
|
|
|
+ {
|
|
|
+ // 서버와 통신 완료 후 에러 리턴
|
|
|
+ showErrorPopup("login error - " + loginResultBean.getReturnMessage());
|
|
|
+ }
|
|
|
}
|
|
|
}, e -> {
|
|
|
// 서버와 통신이 되지 않은 에러
|
|
|
@@ -142,6 +142,23 @@ public class ActivityStarter {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void onLogin(String errorMessage) {
|
|
|
+
|
|
|
+ if (SuperModel.getInstance().isBlockMember()) {
|
|
|
+ gotoScreen(BlockMemberActivity.class);
|
|
|
+ }
|
|
|
+ else if (SuperModel.getInstance().isRestMember()) {
|
|
|
+ gotoScreen(RestMemberActivity.class);
|
|
|
+ }
|
|
|
+ else if (SuperModel.getInstance().isOutMember()) {
|
|
|
+ showErrorPopup("탈퇴한 회원입니다.");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ // data 이상
|
|
|
+ showErrorPopup("login error - " + errorMessage);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private DialogBase alertDialog;
|
|
|
|
|
|
private void showErrorPopup(String errorMessage) {
|
|
|
@@ -171,11 +188,6 @@ public class ActivityStarter {
|
|
|
context.startActivity(intent);
|
|
|
}
|
|
|
|
|
|
- private void setDeviceId(String deviceId) {
|
|
|
- Log.w("APP# SplashActivity | setDeviceId", "| " + deviceId);
|
|
|
- SuperModel.getInstance().setDeviceId(deviceId);
|
|
|
- }
|
|
|
-
|
|
|
public void dispose() {
|
|
|
if (null != alertDialog) {
|
|
|
alertDialog.dispose();
|