woody 1 anno fa
parent
commit
dd8c1a1333

+ 4 - 4
framework-redis/src/main/java/com/chelvc/framework/redis/util/RedisUtils.java

@@ -536,9 +536,9 @@ public class RedisUtils implements ApplicationContextAware {
             String value = StringUtils.rjust(String.valueOf(random.nextInt(100000)), 5, '0');
             String value = StringUtils.rjust(String.valueOf(random.nextInt(100000)), 5, '0');
             long identity = Long.parseLong(time + value);
             long identity = Long.parseLong(time + value);
             byte[] key = (SEQUENCE_REDIS_PREFIX + identity).getBytes(StandardCharsets.UTF_8);
             byte[] key = (SEQUENCE_REDIS_PREFIX + identity).getBytes(StandardCharsets.UTF_8);
-            Boolean successful = execute(connection -> connection.set(key, ObjectUtils.EMPTY_BYTES,
+            Boolean success = execute(connection -> connection.set(key, ObjectUtils.EMPTY_BYTES,
                     Expiration.from(duration), RedisStringCommands.SetOption.SET_IF_ABSENT));
                     Expiration.from(duration), RedisStringCommands.SetOption.SET_IF_ABSENT));
-            if (Boolean.TRUE.equals(successful)) {
+            if (Boolean.TRUE.equals(success)) {
                 return identity;
                 return identity;
             }
             }
         }
         }
@@ -944,9 +944,9 @@ public class RedisUtils implements ApplicationContextAware {
         for (int i = 0; i < 10; i++) {
         for (int i = 0; i < 10; i++) {
             String value = supplier.get();
             String value = supplier.get();
             byte[] key = (RANDOM_REDIS_PREFIX + value).getBytes(StandardCharsets.UTF_8);
             byte[] key = (RANDOM_REDIS_PREFIX + value).getBytes(StandardCharsets.UTF_8);
-            Boolean successful = execute(connection -> connection.set(key, ObjectUtils.EMPTY_BYTES,
+            Boolean success = execute(connection -> connection.set(key, ObjectUtils.EMPTY_BYTES,
                     Expiration.from(duration), RedisStringCommands.SetOption.SET_IF_ABSENT));
                     Expiration.from(duration), RedisStringCommands.SetOption.SET_IF_ABSENT));
-            if (Boolean.TRUE.equals(successful)) {
+            if (Boolean.TRUE.equals(success)) {
                 return value;
                 return value;
             }
             }
         }
         }

+ 2 - 2
framework-security/src/main/java/com/chelvc/framework/security/signature/RedisSigner.java

@@ -29,9 +29,9 @@ public class RedisSigner implements Signer {
         Assert.isTrue(expiration > 0, "expiration must greater than 0");
         Assert.isTrue(expiration > 0, "expiration must greater than 0");
         String signature = SecurityContextHolder.sign(parameters);
         String signature = SecurityContextHolder.sign(parameters);
         byte[] key = (SIGNATURE_REDIS_PREFIX + signature).getBytes(StandardCharsets.UTF_8);
         byte[] key = (SIGNATURE_REDIS_PREFIX + signature).getBytes(StandardCharsets.UTF_8);
-        Boolean successful = RedisUtils.execute(connection -> connection.set(key, ObjectUtils.EMPTY_BYTES,
+        Boolean success = RedisUtils.execute(connection -> connection.set(key, ObjectUtils.EMPTY_BYTES,
                 Expiration.from(expiration, TimeUnit.SECONDS), RedisStringCommands.SetOption.SET_IF_ABSENT));
                 Expiration.from(expiration, TimeUnit.SECONDS), RedisStringCommands.SetOption.SET_IF_ABSENT));
-        if (!Boolean.TRUE.equals(successful)) {
+        if (!Boolean.TRUE.equals(success)) {
             throw new RuntimeException("Sign failed");
             throw new RuntimeException("Sign failed");
         }
         }
         return signature;
         return signature;