Authored by tanling

邀请码前缀不区分大小写

@@ -15,10 +15,15 @@ public enum InviterType { @@ -15,10 +15,15 @@ public enum InviterType {
15 // 邀请码数字部分 15 // 邀请码数字部分
16 private String value; 16 private String value;
17 17
  18 +
18 public void setValue(String value) { 19 public void setValue(String value) {
19 this.value = value; 20 this.value = value;
20 } 21 }
21 22
  23 + public String getValue() {
  24 + return value;
  25 + }
  26 +
22 public int getType() { 27 public int getType() {
23 return type; 28 return type;
24 } 29 }
@@ -127,11 +127,7 @@ public class InviteServiceImpl implements IInviteService { @@ -127,11 +127,7 @@ public class InviteServiceImpl implements IInviteService {
127 throw new ServiceException(ServiceError.INVITE_CODE_NOT_EXIST); 127 throw new ServiceException(ServiceError.INVITE_CODE_NOT_EXIST);
128 } 128 }
129 129
130 - String inviteCode = showInviteCode.replaceFirst(inviterType.getAlphabet(), "");  
131 - if (!inviteCode.matches("\\d+")){  
132 - LOGGER.warn("invite invalidate, showInviteCode is {}", showInviteCode);  
133 - throw new ServiceException(ServiceError.INVITE_CODE_NOT_EXIST);  
134 - } 130 + String inviteCode = inviterType.getValue();
135 131
136 // 未开始 132 // 未开始
137 InviteActivity inviteActivity = inviteActivityMapper.selectLastActivtiy(); 133 InviteActivity inviteActivity = inviteActivityMapper.selectLastActivtiy();
@@ -390,11 +386,7 @@ public class InviteServiceImpl implements IInviteService { @@ -390,11 +386,7 @@ public class InviteServiceImpl implements IInviteService {
390 return 0; 386 return 0;
391 } 387 }
392 388
393 - String inviteCode = showInviteCode.replaceFirst(inviterType.getAlphabet(),"");  
394 - if (!inviteCode.matches("\\d+")){  
395 - LOGGER.warn("[{}] [{}] [{}]. invite code invaliate.", showInviteCode, uid, orderCode);  
396 - return 0 ;  
397 - } 389 + String inviteCode = inviterType.getValue();
398 390
399 Inviter inviter = inviterMapper.selectValidateInviter(inviterType.getType(), Integer.parseInt(inviteCode)); 391 Inviter inviter = inviterMapper.selectValidateInviter(inviterType.getType(), Integer.parseInt(inviteCode));
400 // 无有效的邀请信息 392 // 无有效的邀请信息