我写了这段代码:
@Service
public class LoginDetailsServiceImpl implements UserDetailsService, Serializable {
@Autowired
LoginService loginService;
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
if (username == "" || username.isEmpty()) {
throw new UsernameNotFoundException(String.format("User %s is invalid!", username));
}
Login login = loginService.find(username);
if (login == null) {
throw new UsernameNotFoundException(String.format("User %s does not exist!", username));
}
if (!loginService.scheduleChecking(login.getScheduled())) {
throw new UsernameNotFoundException(String.format("User %s is not authorized this time!", username));
}
//....
我应该如何知道等待时间(以秒为单位)? 我希望家长会等待他的孩子最多5秒,我想这1000圈但我不确定....
谢谢!