mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
静态redis工具类
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package com.jsowell.common.core.redis;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
/**
|
||||
* @Description 静态方法中调用redis
|
||||
* @Author qizhentao
|
||||
* @Date 2020/7/1 11:27
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Component
|
||||
public class StaticRedisCache {
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
public static RedisCache staticRedisCache;
|
||||
|
||||
// 项目启动时把redisUtil交给静态的staticRedisUtil
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
staticRedisCache = this.redisCache;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user