Procházet zdrojové kódy

[설정][New] 사용한 스페셜 코드(-400) 얼럿 처리

hyodong.min před 6 roky
rodič
revize
ec3b0af57d

+ 1 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/bean/api/MemberCodeResultBean.java

@@ -15,6 +15,7 @@ package kr.co.zumo.app.lifeplus.bean.api;
  */
 public class MemberCodeResultBean extends LifeplusAPIResultObjectBean<CodeBean> {
 
+  public static final int USED_SPACIAL_CODE = -400;
   public static final int INVALID_SPACIAL_CODE = -500;
   public static final int INVALID_RECOMMEND_CODE = -600;
 

+ 1 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/Event.java

@@ -224,6 +224,7 @@ public class Event {
   public static final int LOADED_BUCKET_BEST = 1052;
   public static final int LOADED_POLICY = 1053;
   public static final int LOADED_EVENT_ANSWER = 1054;
+  public static final int CODE_USED_SPECIAL_CODE = 1055;
 
   // boolean
   public static final String TRUE = "TRUE";

+ 3 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/setting/code/SettingCodeModel.java

@@ -284,6 +284,9 @@ public class SettingCodeModel extends CoinModel {
         else if (resultBean.getCode() == MemberCodeResultBean.INVALID_RECOMMEND_CODE) {
           onResult(new Event.Builder(Event.RESULT).integer(Event.CODE_INVALID_RECOMMEND_CODE).build());
         }
+        else if (resultBean.getCode() == MemberCodeResultBean.USED_SPACIAL_CODE) {
+          onResult(new Event.Builder(Event.RESULT).integer(Event.CODE_USED_SPECIAL_CODE).build());
+        }
         else {
           onResult(new Event.Builder(Event.ERROR).string(resultBean.getReturnMessage()).build());
         }

+ 7 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/setting/code/SettingCodePresenter.java

@@ -115,6 +115,9 @@ public class SettingCodePresenter extends Presenter<SettingCodeModel, ISettingCo
         else if (resultIndex == Event.CODE_INVALID_RECOMMEND_CODE) {
           onInvalidCode(Event.CODE_INVALID_RECOMMEND_CODE);
         }
+        else if (resultIndex == Event.CODE_USED_SPECIAL_CODE) {
+          onInvalidCode(Event.CODE_USED_SPECIAL_CODE);
+        }
         break;
       case Event.ERROR:
         showErrorDialog(event.getString());
@@ -204,6 +207,10 @@ public class SettingCodePresenter extends Presenter<SettingCodeModel, ISettingCo
     else if (resultIndex == Event.CODE_INVALID_RECOMMEND_CODE) {
       view.setValidationRecommendCode(ResourceUtil.getString(R.string.recommend_code_error));
     }
+    else if (resultIndex == Event.CODE_USED_SPECIAL_CODE) {
+      // 사용한 스페셜 코드 팝업 표시
+      showErrorDialog(R.string.special_code_error_used);
+    }
 
     view.setEnabledAll(true);
 

+ 1 - 0
app/src/main/res/values/strings.xml

@@ -298,6 +298,7 @@
   <string name="special_code_characters">4자리</string>
   <string name="special_code_input">지급받은 코드가 있는 경우 입력해주세요.</string>
   <string name="special_code_error">"&lt;font color='#F13F15'>지급받은 코드가 유효하지 않습니다.&lt;/font>"</string>
+  <string name="special_code_error_used">이미 사용하신 코드는 재등록이 불가능합니다.</string>
   <string name="recommend_code_input">지급받은 코드가 있는 경우 입력해주세요.</string>
   <string name="recommend_code_error">"&lt;font color='#F13F15'>지급받은 코드가 유효하지 않습니다.&lt;/font>"</string>
   <string name="special_code_input_need_12_characters">"&lt;font color='#F13F15'>지급받은 코드 12자리를 입력해주세요.&lt;/font>"</string>