时间段获取


 String v = configServiceImpl.query(IConfigService.ConfigKey.AUTH_PHONE_VALID_DAYS);

         long validDays = null != v ? Long.valueOf(v) : Long.MAX_VALUE;

        for (AuthPhone authPhone : authPhoneList) {

            long days = ChronoUnit.DAYS.between(authPhone.getAuthTime().toInstant(), (new Date()).toInstant());

            authPhone.setIsExpired(days > validDays ? true : false);

            if (authPhone.getAuthState().equals(AuthState.AUTH_SUCCESS.getCode()) && authPhone.getIsExpired()) {

                authPhone.setAuthState(AuthState.AUTH_INVALID.getCode());

                authPhoneMapper.updateAuthState(authPhone);

            }

        }

原文链接:,转发请注明来源!

Leave a Reply

You must be logged in to post a comment.