• 主页
  • 读书笔记
  • 备案号:滇ICP备19009238号
所有文章 其他站点 关于我

  • 主页
  • 读书笔记
  • 备案号:滇ICP备19009238号

Redis简单实例

2022-07-05

Redis简单实例

配置文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
## redis配置
spring.redis.host=xxx
spring.redis.port=6379
spring.redis.password=xxx
## Redis数据库索引(默认为0)
spring.redis.database=0
spring.redis.timeout=30000
spring.redis.maxTotal=30
spring.redis.maxIdle=10
spring.redis.maxWaitMillis=1500
spring.redis.blockWhenExhausted=false
spring.redis.JmxEnabled=true
## 连接池最大连接数(使用负值表示没有限制)
spring.redis.jedis.poll.max-active=50
## 连接池最大阻塞等待时间(使用负值表示没有限制)
spring.redis.jedis.poll.max-wait=3000
## 连接池中的最大空闲连接
spring.redis.jedis.poll.max-idle=20
## 连接池中的最小空闲连接
spring.redis.jedis.poll.min-idle=2
## 连接超时时间(毫秒)
spring.redis.jedis.timeout=5000

配置类

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.interceptor.KeyGenerator;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.cache.RedisCacheManager;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;

import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;

/**
* @description Redis配置类
*/
@Configuration
@EnableCaching
public class RedisConfig extends CachingConfigurerSupport {

/**
* 生成key的策略【默认第一种】 如果不指定,则按照本方法的key生成策略去拼接key
* 例如:com.sxd.service.UserServiceImpl.save:com.sxd.entity.User@7c9359ec
*
* @return
*/
@Override
@Bean
public KeyGenerator keyGenerator() {
return new KeyGenerator() {
@Override
public Object generate(Object target, Method method, Object... params) {
StringBuilder sb = new StringBuilder();
sb.append(target.getClass().getName() + ".");
sb.append(method.getName());
for (Object obj : params) {
sb.append(":" + obj.toString());
}
return sb.toString();
}
};
}

/**
* 生成key的策略【自定义第二种】 使用时在注解@Cacheable(value = "12s",keyGenerator = "listKeyGenerator")中指定
*
* @return
*/
@Bean(name = "listKeyGenerator")
public KeyGenerator listKeyGenerator() {
return new KeyGenerator() {
@Override
public Object generate(Object target, Method method, Object... params) {
StringBuilder sb = new StringBuilder();
sb.append(method.getName());
return sb.toString();
}
};
}

/** 缓存管理 */
@Bean
public CacheManager cacheManager(RedisConnectionFactory factory) {
RedisCacheManager rcm = RedisCacheManager.builder(factory).build();

return rcm;
}

/** RedisTemplate配置 Redis序列化 */
@Bean
public RedisTemplate<String, String> redisTemplate(RedisConnectionFactory factory) {
StringRedisTemplate template = new StringRedisTemplate(factory);
Jackson2JsonRedisSerializer jackson2JsonRedisSerializer =
new Jackson2JsonRedisSerializer(Object.class);
ObjectMapper om = new ObjectMapper();
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
jackson2JsonRedisSerializer.setObjectMapper(om);
template.setValueSerializer(jackson2JsonRedisSerializer);
template.afterPropertiesSet();
return template;
}
}

常量类

1
2
3
4
5
6
7
8
9
/**
* @description Redis常量
*/
public class RedisConstants {
// 打榜信息
public static final String ACTIVITY_RANKING_LIST_KEY = "activity_ranking_list_key:";
public static final long ACTIVITY_RANKING_LIST_KEY_EXPIRE_TIME = 600L;
}

工具类

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.*;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit;

/** @description Redis工具类 */
@Component
@Slf4j
public class RedisUtil {

@Autowired private RedisTemplate redisTemplate;

/**
* +1 -1
*
* @param key
* @param delta
* @return
*/
public Long incr(String key, long delta) {
return redisTemplate.opsForValue().increment(key, delta);
}

public Long decr(String key, long delta) {
return redisTemplate.opsForValue().increment(key, -delta);
}

/**
* 写入缓存
*
* @param key
* @param value
* @return
*/
public boolean set(final String key, Object value) {
boolean result = false;
try {
ValueOperations<Serializable, Object> operations = redisTemplate.opsForValue();
operations.set(key, value);
result = true;
} catch (Exception e) {
log.error(e.getMessage());
}
return result;
}

/**
* 写入缓存设置失效时间
*
* @param key
* @param value
* @param expireTime 秒
* @return
*/
public boolean set(final String key, Object value, Long expireTime) {
boolean result = false;
try {
ValueOperations<Serializable, Object> operations = redisTemplate.opsForValue();
operations.set(key, value);
redisTemplate.expire(key, expireTime, TimeUnit.SECONDS);
result = true;
} catch (Exception e) {
log.error(e.getMessage());
}
return result;
}

/**
* 批量删除对应的value
*
* @param keys
*/
public void remove(final String... keys) {
for (String key : keys) {
remove(key);
}
}

/**
* 批量删除key
*
* @param pattern
*/
public void removePattern(final String pattern) {
Set<Serializable> keys = redisTemplate.keys(pattern);
if (keys.size() > 0) redisTemplate.delete(keys);
}

/**
* 根据key删除对应的value
*
* @param key
*/
public void remove(final String key) {
if (exists(key)) {
redisTemplate.delete(key);
}
}

/**
* 根据key判断缓存中是否有对应的value
*
* @param key
* @return
*/
public boolean exists(final String key) {
return redisTemplate.hasKey(key);
}

/**
* 根据key读取缓存
*
* @param key
* @return
*/
public Object get(final String key) {
Object result = null;
ValueOperations<Serializable, Object> operations = redisTemplate.opsForValue();
result = operations.get(key);
return result;
}

/**
* 根据key读取缓存
*
* @param key
* @return
*/
public String getAsString(final String key) {
Object result = null;
ValueOperations<Serializable, Object> operations = redisTemplate.opsForValue();
result = operations.get(key);
if (result == null) return null;
return result.toString();
}

/**
* 哈希 添加
*
* @param key
* @param hashKey
* @param value
*/
public boolean hmSet(String key, Object hashKey, Object value, Long expireTime) {
boolean result = false;
try {
HashOperations<String, Object, Object> hash = redisTemplate.opsForHash();
hash.put(key, hashKey, value);
redisTemplate.expire(key, expireTime, TimeUnit.SECONDS);
result = true;
} catch (Exception e) {
log.error(e.getMessage());
}
return result;
}

/**
* 哈希 添加
*
* @param key
* @param hashKey
* @param value
*/
public void hmSet(String key, Object hashKey, Object value) {
HashOperations<String, Object, Object> hash = redisTemplate.opsForHash();
hash.put(key, hashKey, value);
}

/**
* 哈希获取数据
*
* @param key
* @param hashKey
* @return
*/
public Object hmGet(String key, Object hashKey) {
HashOperations<String, Object, Object> hash = redisTemplate.opsForHash();
return hash.get(key, hashKey);
}

/**
* 列表添加
*
* @param k
* @param v
*/
public void lPush(String k, Object v) {
ListOperations<String, Object> list = redisTemplate.opsForList();
list.rightPush(k, v);
}

/**
* 列表获取
*
* @param k
* @param l
* @param l1
* @return
*/
public List<Object> lRange(String k, long l, long l1) {
ListOperations<String, Object> list = redisTemplate.opsForList();
return list.range(k, l, l1);
}

/**
* 集合添加
*
* @param key
* @param value
*/
public void add(String key, Object value) {
SetOperations<String, Object> set = redisTemplate.opsForSet();
set.add(key, value);
}

/**
* 集合获取
*
* @param key
* @return
*/
public Set<Object> setMembers(String key) {
SetOperations<String, Object> set = redisTemplate.opsForSet();
return set.members(key);
}

/**
* 有序集合添加
*
* @param key
* @param value
* @param scoure
*/
public void zAdd(String key, Object value, double scoure) {
ZSetOperations<String, Object> zset = redisTemplate.opsForZSet();
zset.add(key, value, scoure);
}

/**
* 有序集合获取
*
* @param key
* @param scoure
* @param scoure1
* @return
*/
public Set<Object> rangeByScore(String key, double scoure, double scoure1) {
ZSetOperations<String, Object> zset = redisTemplate.opsForZSet();
return zset.rangeByScore(key, scoure, scoure1);
}

/**
* 实现命令 : SRANDMEMBER key [count] 随机返回指定个数的成员
*
* @param key
* @return
*/
public Object sRandMember(String key) {
return redisTemplate.opsForSet().randomMember(key);
}
}

分布式锁类

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

/**
* @Description //直接使用Redis进行分布式锁 这是简易版本 如果要使用Redis原生锁记得加过期时间,防止死锁 最好使用Redisson操作简单更加方便 @Date $
* $ @Author huangwb
*/
@Component
public class RedisLockCommon {

@Autowired private StringRedisTemplate stringRedisTemplate;

/**
* Redis加锁的操作
*
* @param key
* @param value
* @return
*/
public Boolean tryLock(String key, String value) {

// 加锁
if (stringRedisTemplate.opsForValue().setIfAbsent(key, value)) {
return true;
}

// 其他人获取不到锁执行如下代码
// 获取锁的值
String currentValue = stringRedisTemplate.opsForValue().get(key);

// 锁的值小于当前时则锁已过期
if (StringUtils.isNotEmpty(currentValue)
&& Long.parseLong(currentValue) < System.currentTimeMillis()) {
// 获取上一个锁的时间 如果高并发的情况可能会出现已经被修改的问题 所以多一次判断保证线程的安全
String oldValue = stringRedisTemplate.opsForValue().getAndSet(key, value);
// 比较锁的getSet获取到的最近锁值和最开始获取到的锁值,如果不相等则证明锁已经被其他线程获取了
if (StringUtils.isNotEmpty(oldValue) && oldValue.equals(currentValue)) {
return true;
}
}
return false;
}

/**
* Redis解锁的操作
*
* @param key
* @param value
*/
public void unlock(String key, String value) {
String currentValue = stringRedisTemplate.opsForValue().get(key);
try {
if (StringUtils.isNotEmpty(currentValue) && currentValue.equals(value)) {
stringRedisTemplate.opsForValue().getOperations().delete(key);
}
} catch (Exception e) {
}
}
}


Jredis

配置类

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

@Slf4j
@Configuration
public class RedisConfig {

@Value("${spring.redis.host}")
private String host;
@Value("${spring.redis.port}")
private int port;
@Value("${spring.redis.password}")
private String password;
@Value("${spring.redis.database}")
private int database;
@Value("${spring.redis.timeout}")
private int timeout;
@Value("${spring.redis.jedis.pool.max-active}")
private int maxTotal;
@Value("${spring.redis.jedis.pool.max-idle}")
private int maxIdle;
@Value("${spring.redis.jedis.pool.min-idle}")
private int minIdle;
@Value("${spring.redis.jedis.pool.max-wait}")
private int maxWait;

@Bean
public JedisPool jedisPool() {
JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
jedisPoolConfig.setMaxTotal(maxTotal);
jedisPoolConfig.setMaxIdle(maxIdle);
jedisPoolConfig.setMinIdle(minIdle);
jedisPoolConfig.setMaxWaitMillis(maxWait);
jedisPoolConfig.setBlockWhenExhausted(false);
return new JedisPool(jedisPoolConfig, host, port, timeout, password, database);
}
}

工具类

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import com.folksapce.demo.api.model.ZsetRangeDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.ScanParams;
import redis.clients.jedis.ScanResult;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class BaseCache {
private static final Logger log = LoggerFactory.getLogger(BaseCache.class);
private JedisPool jedisPool;

public BaseCache(JedisPool jedisPool) {
this.jedisPool = jedisPool;
}

protected void setEx(String key, int exTime, String str) {
try (Jedis jedis = jedisPool.getResource()) {
jedis.setex(key, exTime, str);
} catch (Exception e) {
log.error("setEx key={}", key, e);
}
}

protected String getByKey(String key) {
String str = null;
try (Jedis jedis = jedisPool.getResource()) {
str = jedis.get(key);
} catch (Exception e) {
log.error("getByKey key={}", key, e);
}
return str;
}

protected void delByKey(String key) {
try (Jedis jedis = jedisPool.getResource()) {
jedis.del(key);
} catch (Exception e) {
log.error("delByKey key={}", key, e);
}
}

protected void zAdd(String key, double score, String member) {
try (Jedis jedis = jedisPool.getResource()) {
jedis.zadd(key, score, member);
} catch (Exception e) {
log.error("zadd member={}", member, e);
}
}

protected ZsetRangeDTO zSetRange(String key, long pageIndex, long pageSize, boolean isReverse) {
long startIndex = (pageIndex - 1) * pageSize;
long endIndex = pageIndex * pageSize - 1;
Set<String> set = new HashSet<>();
try (Jedis jedis = jedisPool.getResource()) {
long starTime = System.currentTimeMillis();
Long count = jedis.zcard(key);
log.info("zcard costTime={}", System.currentTimeMillis() - starTime);
if (count <= 0) {
return null;
} else if (count > startIndex) {
starTime = System.currentTimeMillis();
if (!isReverse) {
set = jedis.zrange(key, startIndex, endIndex);
} else {
set = jedis.zrevrange(key, startIndex, endIndex);
}
log.info("zrange costTime={}", System.currentTimeMillis() - starTime);
}
} catch (Exception e) {
log.error("zSetRange key={}", key, e);
}
return new ZsetRangeDTO().setSet(set).setCount(count);
}

protected void zSetDelVa(String key, String member) {
try (Jedis jedis = jedisPool.getResource()) {
jedis.zrem(key, member);
} catch (Exception e) {
log.error("zSetDelVa key={}", key, e);
}
}

public void delKeyByScan(String pattern) {
ScanParams scanParams = new ScanParams();
scanParams.count(1000);
scanParams.match(pattern);
String cursor = ScanParams.SCAN_POINTER_START;
try (Jedis jedis = jedisPool.getResource()) {
do {
ScanResult<String> scanResult = jedis.scan(cursor, scanParams);
List<String> list = scanResult.getResult();
for (String s : list) {
jedis.del(s);
}
cursor = scanResult.getCursor();
} while (cursor != null && !"0".equals(cursor));
} catch (Exception e) {
log.error("delKeyByScan pattern={}", pattern, e);
}
}
}

数据传输体ZsetRangeDTO

1
2
3
4
5
6
7
8
9
10
11
12
13
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.Set;

@Setter
@Getter
@Accessors(chain = true)
public class ZsetRangeDTO {
private Set<String> set;
private int count;
}
  • Redis
SpringBoot单种类多筛选实现
Redis缓存排序及分页
  1. 1. 配置文件
  2. 2. 配置类
  3. 3. 常量类
  4. 4. 工具类
  5. 5. 分布式锁类
  6. 6. Jredis
    1. 6.1. 配置类
    2. 6.2. 工具类
    3. 6.3. 数据传输体ZsetRangeDTO
© 2023 曳戈泰尔
Hexo Theme Yilia by Litten
  • 所有文章
  • 其他站点
  • 关于我

tag:

  • SHA256
  • AI换脸
  • VITS
  • APM
  • Anaconda
  • AnsibleAWX
  • ArrayList
  • Bean
  • BigDecimal
  • Blender three.js
  • API开放接口
  • xmlRPC
  • Ice
  • MySQL
  • BeanUtils
  • Tomcat
  • Caffeine
  • gradle
  • Docker
  • jdk
  • maven
  • JDK
  • localtime
  • Minio
  • PostgreSQL
  • RT_Linux
  • kafka
  • geany
  • CentOS
  • Elasticsearch
  • Node
  • FastDFS
  • Nginx
  • CompletableFutures
  • CompletableFuture
  • CountDownLatch
  • queue
  • Conflux
  • DefaultIdentifierGenerator
  • gdb
  • Deepin
  • Deferred
  • 自动化部署
  • Nacos
  • Redis
  • RocketMQ
  • docker-compose
  • docker日志
  • Docker部署
  • Drools
  • Vue
  • 持有者作为调用者
  • Error
  • ES
  • 签名上链
  • FISCO
  • Prometheus-Grafana-nodeExporter
  • FISCO开放平台
  • 解析input
  • ForkJoinPool
  • GateWay
  • Git
  • GeoServer
  • GitLab
  • Gradle
  • Spring
  • Gitlab
  • HTTP
  • Hexo GitHub-Pages
  • HttpUtil
  • IDEA
  • Gson
  • 热部署
  • HttpClientUtil
  • 搜索
  • Stream
  • foreach
  • Graphics2D
  • Synchronized
  • 循环
  • Integer
  • base64
  • JAVA
  • Excel
  • openID
  • NowTime
  • MD5
  • 字节流
  • 手机号
  • 支付宝
  • Object
  • 行政区划
  • 序列化
  • telnet
  • 枚举
  • 限流
  • 配置文件
  • 规则执行器
  • cmd
  • netty websocket
  • JAVE2
  • 线程池
  • 分治
  • JMH
  • JVM
  • Jenkins
  • Java调用AI输入输出
  • JWT
  • Kindle
  • Knif4j
  • jar
  • UDP
  • SonarQube
  • 部署
  • Ansible
  • IP
  • socket
  • List排序
  • MQ
  • MapStruct
  • Maven
  • MyBatis-Plus
  • MyBatis
  • 跳板机
  • event
  • trigger
  • 全文索引
  • 扣费 线程安全
  • MybatisPlus
  • LambdaQueryWrapper
  • Navicat
  • Explain
  • 私人助理
  • nacos
  • Nexus
  • WebSocket
  • OSS
  • OkHttpClient
  • OA
  • PicGo
  • 可视化监控
  • Optional
  • SpringBoot
  • 关键词
  • TSV
  • 性能指标
  • json
  • Pycharm
  • 文件夹遍历
  • TCP
  • Qt
  • QueryWrapper
  • Quartz
  • RSA
  • RabbitMQ
  • RateLimiter
  • Redisson
  • 阻塞等待锁
  • ZSET
  • incr
  • 频率限制
  • SAE
  • RESTful API
  • SCP
  • RuoYi
  • SM3
  • SKU
  • SQL
  • SQL前n天
  • SSL
  • Shell脚本自动化
  • Sleuth
  • Socket
  • PageHelper
  • Solidity
  • gateway
  • Batch
  • Spring Boot
  • build.gradle
  • Schedule
  • 循环重试
  • Undertow
  • 多筛选
  • IPFS
  • Jasypt
  • logback
  • 加解密
  • 幂等性
  • Result
  • log
  • Mail
  • 滑块
  • Druid
  • knife4j
  • 注入
  • Full Lite
  • 权限
  • 跨域访问
  • starter
  • 防刷
  • XSS
  • Event
  • 多数据库
  • Scheduled
  • yml
  • Async
  • AOP
  • CurrentUser
  • AutoGenerator
  • netty
  • Openfeign
  • Sentinel
  • Shiro
  • Swagger
  • XMLRPC
  • captcha
  • OAuth
  • 文件上传
  • 验证码登录
  • Response
  • Exception
  • 文件下载
  • 自定义注解
  • Thread
  • 观察者
  • 音视频
  • dll
  • StopWatch
  • String
  • Transactional
  • ThreadLocal
  • TLS
  • 挂载
  • VMware
  • VPN
  • VSAT
  • VScode
  • VS
  • Valid
  • 二维码
  • three.js
  • ECDSA
  • Tornado
  • WorkBench
  • VxWorks
  • select
  • taskSpawn
  • WPS
  • WeBase
  • JavaScript
  • COOKIE
  • 消息推送
  • 开启启动
  • VxWorks WorkBench
  • XStream
  • ab
  • appId appKey
  • printStackTrace
  • gitlab
  • excel2word
  • git
  • 经纬度
  • isNull isEmpty isBlank
  • mybatisplus
  • SSH
  • nohup日志
  • phpstudy
  • npm
  • 图片
  • nginx
  • url
  • xml
  • 去背景
  • 提取学号
  • 一键登录
  • xxl-job
  • 并发
  • 接口
  • 一致性HASH
  • 责任链
  • 两层请求体
  • 二次支付
  • 个人支付
  • 设计模式
  • 代理
  • MERGE
  • 保存MultipartFile
  • PDF
  • 链间数据迁移
  • session
  • 鉴权
  • 证书生成
  • 单例
  • 压测
  • shell
  • 发布Jar
  • sms
  • 升级代理合约
  • 支付
  • 图片转PDF
  • 拍平JSON
  • SSO
  • property
  • 内容安全
  • 循环分页
  • crontab
  • 日志清理
  • 实名
  • 绩效
  • 读书笔记
  • 歌词识别
  • component初始化
  • 抽奖
  • 数据脱敏
  • 验证码
  • 网络攻防
  • 慢排查
  • Native支付
  • 裁剪字符串
  • WebView
  • 文本折叠
  • 上拉加载数据
  • 弹窗输入框
  • 图片裁剪
  • banner
  • 局部刷新
  • 弹窗
  • StorageSync
  • 标签id值
  • openId
  • 角标
  • globalData
  • url传值
  • Feign
  • 懒加载
  • 订阅消息
  • 设备交接
  • 提取txt 提取word
  • 回调
  • 支付超时
  • Assert
  • 乐观锁
  • 服务器
  • 监控
  • 运维
  • 方案
  • Enum
  • 测试
  • 校招
  • 死锁
  • 兑换码
  • 订单
  • 余额扣减
  • sku gson
  • 电商
  • 短信验证码
  • 伏羲PDF
  • 秒杀
  • 后台
  • 不可破解key
  • 排查
  • 线程安全 Map List
  • 上下电
  • CRUD拆分的宽表
  • ip2region
  • 行政
  • 文件校验FileSize
  • ParameterMap
  • EventBus
  • 微信手机号
  • 购买掉单
  • resources
  • 音频时长
  • IDCardUtils
  • Ghelper
  • Forest
  • 邀请
  • 过滤器 拦截器
  • 通信
  • Retry
  • 人脸融合
  • 时间差
  • 短信
  • 集合
  • 长安链

    缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    3、在根目录_config.yml里添加配置:

      jsonContent:
        meta: false
        pages: false
        posts:
          title: true
          date: true
          path: true
          text: false
          raw: false
          content: false
          slug: false
          updated: false
          comments: false
          link: false
          permalink: false
          excerpt: false
          categories: false
          tags: true
    

  • 区块链
  • GPT
  • gitee1
  • gitee2
  • github
  • Other
徘徊在原子与字节的边缘

将更好的自己呈现给世界



修心至要,事上磨练

一蓑衣,一壶酒,一曲长歌,一剑天涯

见自己,见天地,见众生