public class PhoneExsitException extends RuntimeException {
public PhoneExsitException() {
super("手机号已存在");
}
}
public void checkUsernameUnique(String username) throws UsernameExsitException {
Integer count = baseMapper.selectCount(new QueryWrapper<MemberEntity>().eq("username", username));
if (count > 0){
throw new UsernameExsitException();
}
}