From 2d4b3ff8ac9df4739e6bbc27b25a6a41bc6f8a3f Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Tue, 8 Nov 2022 21:36:01 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=907.3.2=E3=80=91=E3=80=90security?= =?UTF-8?q?=E3=80=91=E6=9B=B4=E6=96=B0=E8=AE=A1=E6=95=B0=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel-d-security/security-sdk-count/pom.xml | 7 +++ ...che.java => CountValidateMemoryCache.java} | 4 +- .../count/cache/CountValidateRedisCache.java | 48 +++++++++++++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) rename kernel-d-security/security-sdk-count/src/main/java/cn/stylefeng/roses/kernel/security/count/cache/{DefaultCountValidateCache.java => CountValidateMemoryCache.java} (91%) create mode 100644 kernel-d-security/security-sdk-count/src/main/java/cn/stylefeng/roses/kernel/security/count/cache/CountValidateRedisCache.java diff --git a/kernel-d-security/security-sdk-count/pom.xml b/kernel-d-security/security-sdk-count/pom.xml index ff7d31b1e..b4f73e8f0 100644 --- a/kernel-d-security/security-sdk-count/pom.xml +++ b/kernel-d-security/security-sdk-count/pom.xml @@ -32,6 +32,13 @@ cn.stylefeng.roses cache-sdk-memory ${roses.version} + true + + + cn.stylefeng.roses + cache-sdk-redis + ${roses.version} + true diff --git a/kernel-d-security/security-sdk-count/src/main/java/cn/stylefeng/roses/kernel/security/count/cache/DefaultCountValidateCache.java b/kernel-d-security/security-sdk-count/src/main/java/cn/stylefeng/roses/kernel/security/count/cache/CountValidateMemoryCache.java similarity index 91% rename from kernel-d-security/security-sdk-count/src/main/java/cn/stylefeng/roses/kernel/security/count/cache/DefaultCountValidateCache.java rename to kernel-d-security/security-sdk-count/src/main/java/cn/stylefeng/roses/kernel/security/count/cache/CountValidateMemoryCache.java index 4557cee6a..da44fbd00 100644 --- a/kernel-d-security/security-sdk-count/src/main/java/cn/stylefeng/roses/kernel/security/count/cache/DefaultCountValidateCache.java +++ b/kernel-d-security/security-sdk-count/src/main/java/cn/stylefeng/roses/kernel/security/count/cache/CountValidateMemoryCache.java @@ -35,9 +35,9 @@ import cn.stylefeng.roses.kernel.security.api.constants.CounterConstants; * @author fengshuonan * @date 2020/11/15 15:26 */ -public class DefaultCountValidateCache extends AbstractMemoryCacheOperator { +public class CountValidateMemoryCache extends AbstractMemoryCacheOperator { - public DefaultCountValidateCache(TimedCache timedCache) { + public CountValidateMemoryCache(TimedCache timedCache) { super(timedCache); } diff --git a/kernel-d-security/security-sdk-count/src/main/java/cn/stylefeng/roses/kernel/security/count/cache/CountValidateRedisCache.java b/kernel-d-security/security-sdk-count/src/main/java/cn/stylefeng/roses/kernel/security/count/cache/CountValidateRedisCache.java new file mode 100644 index 000000000..ef07296ad --- /dev/null +++ b/kernel-d-security/security-sdk-count/src/main/java/cn/stylefeng/roses/kernel/security/count/cache/CountValidateRedisCache.java @@ -0,0 +1,48 @@ +/* + * Copyright [2020-2030] [https://www.stylefeng.cn] + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: + * + * 1.请不要删除和修改根目录下的LICENSE文件。 + * 2.请不要删除和修改Guns源码头部的版权声明。 + * 3.请保留源码和相关描述文件的项目出处,作者声明等。 + * 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns + * 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns + * 6.若您的项目无法满足以上几点,可申请商业授权 + */ +package cn.stylefeng.roses.kernel.security.count.cache; + +import cn.stylefeng.roses.kernel.cache.redis.AbstractRedisCacheOperator; +import cn.stylefeng.roses.kernel.security.api.constants.CounterConstants; +import org.springframework.data.redis.core.RedisTemplate; + +/** + * 图形验证码缓存 + * + * @author chenjinlong + * @date 2021/1/15 13:44 + */ +public class CountValidateRedisCache extends AbstractRedisCacheOperator { + + public CountValidateRedisCache(RedisTemplate redisTemplate) { + super(redisTemplate); + } + + @Override + public String getCommonKeyPrefix() { + return CounterConstants.COUNT_VALIDATE_CACHE_KEY_PREFIX; + } + +}