id唯一性校验

This commit is contained in:
wenyann 2020-05-11 16:26:42 +08:00
parent c6b4dd0948
commit 31102c3b82
1 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ public class UserService {
String id = user.getId(); String id = user.getId();
User user1 = userMapper.selectByPrimaryKey(id); User user1 = userMapper.selectByPrimaryKey(id);
if (user1 != null) { if (user1 != null) {
MSException.throwException("user_id_already_exists"); MSException.throwException(Translator.get("user_id_already_exists"));
}else{ }else{
createUser(user); createUser(user);
} }
@ -300,7 +300,7 @@ public class UserService {
return user; return user;
} }
} }
MSException.throwException("password_modification_failed"); MSException.throwException(Translator.get("password_modification_failed"));
} }
return null; return null;
} }