refactor: 后端核心模块功能增强与代码优化
- 完善 User/Product/Order 实体字段和关联关系 - 更新 DTO 适配新增字段 - 增强 Service 层业务逻辑和 Repository 查询方法 - 优化控制器接口,完善管理后台 API - 新增请求监控过滤器和指标服务
This commit is contained in:
@@ -326,6 +326,24 @@ public class RedisService {
|
||||
return redisTemplate.hasKey(key);
|
||||
}
|
||||
|
||||
public String ping() {
|
||||
try {
|
||||
return stringRedisTemplate.getConnectionFactory().getConnection().ping();
|
||||
} catch (Exception e) {
|
||||
log.error("Redis ping失败", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Properties info(String section) {
|
||||
try {
|
||||
return stringRedisTemplate.getConnectionFactory().getConnection().info(section);
|
||||
} catch (Exception e) {
|
||||
log.error("Redis info获取失败", e);
|
||||
return new Properties();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置键的过期时间
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user