mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-10 08:57:14 +08:00
perf: 集成 Spring Cache,优化查询用户昵称性能
This commit is contained in:
@@ -21,6 +21,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.redisson.codec.JsonJacksonCodec;
|
||||
import org.redisson.spring.starter.RedissonAutoConfigurationCustomizer;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@@ -33,6 +34,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
* @since 2022/12/28 23:17
|
||||
*/
|
||||
@Slf4j
|
||||
@EnableCaching
|
||||
@Configuration
|
||||
@RequiredArgsConstructor
|
||||
public class RedissonConfiguration {
|
||||
|
@@ -42,4 +42,9 @@ public class CacheConsts {
|
||||
* 限流键前缀
|
||||
*/
|
||||
public static final String LIMIT_KEY_PREFIX = "LIMIT";
|
||||
|
||||
/**
|
||||
* 用户缓存键前缀
|
||||
*/
|
||||
public static final String USER_KEY_PREFIX = "USER";
|
||||
}
|
||||
|
Reference in New Issue
Block a user