Authored by tanling

邀请码前缀不区分大小写

... ... @@ -15,10 +15,15 @@ public enum InviterType {
// 邀请码数字部分
private String value;
public void setValue(String value) {
this.value = value;
}
public String getValue() {
return value;
}
public int getType() {
return type;
}
... ...
... ... @@ -127,11 +127,7 @@ public class InviteServiceImpl implements IInviteService {
throw new ServiceException(ServiceError.INVITE_CODE_NOT_EXIST);
}
String inviteCode = showInviteCode.replaceFirst(inviterType.getAlphabet(), "");
if (!inviteCode.matches("\\d+")){
LOGGER.warn("invite invalidate, showInviteCode is {}", showInviteCode);
throw new ServiceException(ServiceError.INVITE_CODE_NOT_EXIST);
}
String inviteCode = inviterType.getValue();
// 未开始
InviteActivity inviteActivity = inviteActivityMapper.selectLastActivtiy();
... ... @@ -390,11 +386,7 @@ public class InviteServiceImpl implements IInviteService {
return 0;
}
String inviteCode = showInviteCode.replaceFirst(inviterType.getAlphabet(),"");
if (!inviteCode.matches("\\d+")){
LOGGER.warn("[{}] [{}] [{}]. invite code invaliate.", showInviteCode, uid, orderCode);
return 0 ;
}
String inviteCode = inviterType.getValue();
Inviter inviter = inviterMapper.selectValidateInviter(inviterType.getType(), Integer.parseInt(inviteCode));
// 无有效的邀请信息
... ...