添加抽屉表单模板.
This commit is contained in:
@@ -14,6 +14,7 @@ import com.orion.ops.framework.common.utils.CryptoUtils;
|
||||
import com.orion.ops.framework.common.utils.IpUtils;
|
||||
import com.orion.ops.framework.common.utils.Kits;
|
||||
import com.orion.ops.framework.common.utils.Valid;
|
||||
import com.orion.ops.framework.redis.core.utils.RedisStrings;
|
||||
import com.orion.ops.framework.redis.core.utils.RedisUtils;
|
||||
import com.orion.ops.module.infra.convert.SystemUserConvert;
|
||||
import com.orion.ops.module.infra.dao.SystemUserDAO;
|
||||
@@ -153,10 +154,10 @@ public class AuthenticationServiceImpl implements AuthenticationService {
|
||||
int refreshCount = refresh.getRefreshCount() + 1;
|
||||
refresh.setRefreshCount(refreshCount);
|
||||
// 设置登陆缓存
|
||||
RedisUtils.setJson(loginKey, UserCacheKeyDefine.LOGIN_TOKEN, refresh);
|
||||
RedisStrings.setJson(loginKey, UserCacheKeyDefine.LOGIN_TOKEN, refresh);
|
||||
if (refreshCount < maxRefreshCount) {
|
||||
// 小于续签最大次数 则再次设置 refreshToken
|
||||
RedisUtils.setJson(refreshKey, UserCacheKeyDefine.LOGIN_REFRESH, refresh);
|
||||
RedisStrings.setJson(refreshKey, UserCacheKeyDefine.LOGIN_REFRESH, refresh);
|
||||
} else {
|
||||
// 大于等于续签最大次数 则删除
|
||||
redisTemplate.delete(refreshKey);
|
||||
@@ -239,7 +240,7 @@ public class AuthenticationServiceImpl implements AuthenticationService {
|
||||
// 修改缓存状态
|
||||
LoginUser loginUser = JSON.parseObject(userInfoCache, LoginUser.class);
|
||||
loginUser.setStatus(UserStatusEnum.LOCKED.getStatus());
|
||||
RedisUtils.setJson(userInfoKey, UserCacheKeyDefine.USER_INFO, loginUser);
|
||||
RedisStrings.setJson(userInfoKey, UserCacheKeyDefine.USER_INFO, loginUser);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -290,7 +291,7 @@ public class AuthenticationServiceImpl implements AuthenticationService {
|
||||
String userInfoKey = UserCacheKeyDefine.USER_INFO.format(id);
|
||||
LoginUser loginUser = SystemUserConvert.MAPPER.toLoginUser(user);
|
||||
loginUser.setRoles(roleCodeList);
|
||||
RedisUtils.setJson(userInfoKey, UserCacheKeyDefine.USER_INFO, loginUser);
|
||||
RedisStrings.setJson(userInfoKey, UserCacheKeyDefine.USER_INFO, loginUser);
|
||||
return loginUser;
|
||||
}
|
||||
|
||||
@@ -323,7 +324,7 @@ public class AuthenticationServiceImpl implements AuthenticationService {
|
||||
loginTokenInfo.setLoginTime(loginTime);
|
||||
loginTokenInfo.setIp(remoteAddr);
|
||||
loginTokenInfo.setLocation(location);
|
||||
RedisUtils.setJson(deviceLoginKey, UserCacheKeyDefine.LOGIN_TOKEN, loginTokenInfo);
|
||||
RedisStrings.setJson(deviceLoginKey, UserCacheKeyDefine.LOGIN_TOKEN, loginTokenInfo);
|
||||
}
|
||||
}
|
||||
// 删除续签信息
|
||||
@@ -358,11 +359,11 @@ public class AuthenticationServiceImpl implements AuthenticationService {
|
||||
.loginTime(loginTime)
|
||||
.location(location)
|
||||
.build();
|
||||
RedisUtils.setJson(loginKey, UserCacheKeyDefine.LOGIN_TOKEN, loginValue);
|
||||
RedisStrings.setJson(loginKey, UserCacheKeyDefine.LOGIN_TOKEN, loginValue);
|
||||
// 生成 refreshToken
|
||||
if (allowRefresh) {
|
||||
String refreshKey = UserCacheKeyDefine.LOGIN_REFRESH.format(id, loginTime);
|
||||
RedisUtils.setJson(refreshKey, UserCacheKeyDefine.LOGIN_REFRESH, loginValue);
|
||||
RedisStrings.setJson(refreshKey, UserCacheKeyDefine.LOGIN_REFRESH, loginValue);
|
||||
}
|
||||
// 返回token
|
||||
return CryptoUtils.encryptBase62(id + ":" + loginTime);
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.orion.lang.utils.collect.Lists;
|
||||
import com.orion.ops.framework.common.constant.Const;
|
||||
import com.orion.ops.framework.common.utils.Valid;
|
||||
import com.orion.ops.framework.redis.core.utils.RedisUtils;
|
||||
import com.orion.ops.framework.redis.core.utils.RedisLists;
|
||||
import com.orion.ops.framework.security.core.utils.SecurityUtils;
|
||||
import com.orion.ops.module.infra.convert.FavoriteConvert;
|
||||
import com.orion.ops.module.infra.dao.FavoriteDAO;
|
||||
@@ -53,9 +53,9 @@ public class FavoriteServiceImpl implements FavoriteService {
|
||||
int effect = favoriteDAO.insert(record);
|
||||
// 设置缓存
|
||||
String key = FavoriteCacheKeyDefine.FAVORITE.format(type, userId);
|
||||
RedisUtils.listPush(key, request.getRelId(), String::valueOf);
|
||||
RedisLists.push(key, request.getRelId(), String::valueOf);
|
||||
// 设置过期时间
|
||||
RedisUtils.setExpire(key, FavoriteCacheKeyDefine.FAVORITE);
|
||||
RedisLists.setExpire(key, FavoriteCacheKeyDefine.FAVORITE);
|
||||
return record.getId();
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public class FavoriteServiceImpl implements FavoriteService {
|
||||
Long userId = request.getUserId();
|
||||
String cacheKey = FavoriteCacheKeyDefine.FAVORITE.format(type, userId);
|
||||
// 获取缓存
|
||||
List<Long> cacheRelIdList = RedisUtils.listRange(cacheKey, Long::valueOf);
|
||||
List<Long> cacheRelIdList = RedisLists.range(cacheKey, Long::valueOf);
|
||||
if (cacheRelIdList.isEmpty()) {
|
||||
// 条件
|
||||
LambdaQueryWrapper<FavoriteDO> wrapper = this.buildQueryWrapper(request);
|
||||
@@ -101,9 +101,9 @@ public class FavoriteServiceImpl implements FavoriteService {
|
||||
cacheRelIdList.add(Const.NONE_ID);
|
||||
}
|
||||
// 设置缓存
|
||||
RedisUtils.listPushAll(cacheKey, cacheRelIdList, String::valueOf);
|
||||
RedisLists.pushAll(cacheKey, cacheRelIdList, String::valueOf);
|
||||
// 设置过期时间
|
||||
RedisUtils.setExpire(cacheKey, FavoriteCacheKeyDefine.FAVORITE);
|
||||
RedisLists.setExpire(cacheKey, FavoriteCacheKeyDefine.FAVORITE);
|
||||
}
|
||||
// 删除防止穿透的 key
|
||||
cacheRelIdList.remove(Const.NONE_ID);
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.orion.lang.utils.collect.Lists;
|
||||
import com.orion.ops.framework.common.constant.ErrorMessage;
|
||||
import com.orion.ops.framework.common.security.LoginUser;
|
||||
import com.orion.ops.framework.common.utils.Valid;
|
||||
import com.orion.ops.framework.redis.core.utils.RedisUtils;
|
||||
import com.orion.ops.framework.redis.core.utils.RedisStrings;
|
||||
import com.orion.ops.module.infra.dao.SystemRoleDAO;
|
||||
import com.orion.ops.module.infra.dao.SystemUserDAO;
|
||||
import com.orion.ops.module.infra.dao.SystemUserRoleDAO;
|
||||
@@ -54,7 +54,7 @@ public class SystemUserRoleServiceImpl implements SystemUserRoleService {
|
||||
// 删除用户关联
|
||||
int effect = systemUserRoleDAO.deleteByUserId(userId);
|
||||
// 更新缓存中的角色
|
||||
RedisUtils.<LoginUser>processSetJson(UserCacheKeyDefine.USER_INFO, s -> {
|
||||
RedisStrings.<LoginUser>processSetJson(UserCacheKeyDefine.USER_INFO, s -> {
|
||||
s.setRoles(Lists.empty());
|
||||
}, userId);
|
||||
return effect;
|
||||
@@ -92,7 +92,7 @@ public class SystemUserRoleServiceImpl implements SystemUserRoleService {
|
||||
systemUserRoleDAO.insertBatch(addUserRoles);
|
||||
effect += addUserRoles.size();
|
||||
// 更新缓存中的角色
|
||||
RedisUtils.<LoginUser>processSetJson(UserCacheKeyDefine.USER_INFO, s -> {
|
||||
RedisStrings.<LoginUser>processSetJson(UserCacheKeyDefine.USER_INFO, s -> {
|
||||
List<String> roleCodeList = userRoles.stream()
|
||||
.map(SystemRoleDO::getCode)
|
||||
.collect(Collectors.toList());
|
||||
@@ -105,7 +105,7 @@ public class SystemUserRoleServiceImpl implements SystemUserRoleService {
|
||||
@Async("asyncExecutor")
|
||||
public void asyncDeleteUserCacheRole(String roleCode, List<Long> userIdList) {
|
||||
for (Long userId : userIdList) {
|
||||
RedisUtils.<LoginUser>processSetJson(UserCacheKeyDefine.USER_INFO, s -> {
|
||||
RedisStrings.<LoginUser>processSetJson(UserCacheKeyDefine.USER_INFO, s -> {
|
||||
List<String> roles = s.getRoles();
|
||||
if (Lists.isEmpty(roles)) {
|
||||
return;
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.orion.ops.framework.common.constant.ErrorCode;
|
||||
import com.orion.ops.framework.common.constant.ErrorMessage;
|
||||
import com.orion.ops.framework.common.security.LoginUser;
|
||||
import com.orion.ops.framework.common.utils.Valid;
|
||||
import com.orion.ops.framework.redis.core.utils.RedisStrings;
|
||||
import com.orion.ops.framework.redis.core.utils.RedisUtils;
|
||||
import com.orion.ops.framework.security.core.utils.SecurityUtils;
|
||||
import com.orion.ops.module.infra.convert.SystemUserConvert;
|
||||
@@ -82,7 +83,7 @@ public class SystemUserServiceImpl implements SystemUserService {
|
||||
int effect = systemUserDAO.updateById(updateRecord);
|
||||
log.info("SystemUserService-updateSystemUserById effect: {}, updateRecord: {}", effect, JSON.toJSONString(updateRecord));
|
||||
// 更新缓存中的花名
|
||||
RedisUtils.<LoginUser>processSetJson(UserCacheKeyDefine.USER_INFO, s -> {
|
||||
RedisStrings.<LoginUser>processSetJson(UserCacheKeyDefine.USER_INFO, s -> {
|
||||
s.setNickname(request.getNickname());
|
||||
}, id);
|
||||
return effect;
|
||||
@@ -112,7 +113,7 @@ public class SystemUserServiceImpl implements SystemUserService {
|
||||
redisTemplate.delete(UserCacheKeyDefine.LOGIN_FAILED_COUNT.format(record.getUsername()));
|
||||
}
|
||||
// 更新缓存中的status
|
||||
RedisUtils.<LoginUser>processSetJson(UserCacheKeyDefine.USER_INFO, s -> {
|
||||
RedisStrings.<LoginUser>processSetJson(UserCacheKeyDefine.USER_INFO, s -> {
|
||||
s.setStatus(request.getStatus());
|
||||
}, id);
|
||||
return effect;
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.orion.lang.utils.collect.Lists;
|
||||
import com.orion.lang.utils.collect.Maps;
|
||||
import com.orion.ops.framework.redis.core.utils.RedisUtils;
|
||||
import com.orion.ops.framework.redis.core.utils.RedisStrings;
|
||||
import com.orion.ops.module.infra.convert.TagRelConvert;
|
||||
import com.orion.ops.module.infra.dao.TagDAO;
|
||||
import com.orion.ops.module.infra.dao.TagRelDAO;
|
||||
@@ -63,7 +63,7 @@ public class TagRelServiceImpl implements TagRelService {
|
||||
tagRelDAO.insertBatch(tagRelList);
|
||||
// 设置缓存
|
||||
String cacheKey = TagCacheKeyDefine.TAG_REL.format(type, relId);
|
||||
RedisUtils.setJson(cacheKey, TagCacheKeyDefine.TAG_REL, TagRelConvert.MAPPER.toCacheList(tagRelList));
|
||||
RedisStrings.setJson(cacheKey, TagCacheKeyDefine.TAG_REL, TagRelConvert.MAPPER.toCacheList(tagRelList));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -90,7 +90,7 @@ public class TagRelServiceImpl implements TagRelService {
|
||||
List<TagRelDO> relList = tagRelDAO.selectList(wrapper);
|
||||
// 设置缓存
|
||||
List<TagCacheDTO> relCacheList = TagRelConvert.MAPPER.toCacheList(relList);
|
||||
RedisUtils.setJson(cacheKey, TagCacheKeyDefine.TAG_REL, relCacheList);
|
||||
RedisStrings.setJson(cacheKey, TagCacheKeyDefine.TAG_REL, relCacheList);
|
||||
return relCacheList;
|
||||
} else {
|
||||
// 返回缓存数据
|
||||
@@ -135,7 +135,7 @@ public class TagRelServiceImpl implements TagRelService {
|
||||
if (cacheValue == null) {
|
||||
cacheValue = Lists.empty();
|
||||
}
|
||||
RedisUtils.setJson(cacheKey, TagCacheKeyDefine.TAG_REL, cacheValue);
|
||||
RedisStrings.setJson(cacheKey, TagCacheKeyDefine.TAG_REL, cacheValue);
|
||||
emptyCacheMap.put(relId, cacheValue);
|
||||
});
|
||||
// 设置返回
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.orion.ops.framework.common.constant.Const;
|
||||
import com.orion.ops.framework.mybatis.core.query.Conditions;
|
||||
import com.orion.ops.framework.redis.core.utils.RedisUtils;
|
||||
import com.orion.ops.framework.redis.core.utils.RedisLists;
|
||||
import com.orion.ops.module.infra.convert.TagConvert;
|
||||
import com.orion.ops.module.infra.dao.TagDAO;
|
||||
import com.orion.ops.module.infra.define.TagCacheKeyDefine;
|
||||
@@ -52,8 +52,8 @@ public class TagServiceImpl implements TagService {
|
||||
// 设置缓存
|
||||
String cacheKey = TagCacheKeyDefine.TAG_NAME.format(type);
|
||||
TagCacheDTO cache = TagConvert.MAPPER.toCache(record);
|
||||
RedisUtils.listPushJson(cacheKey, cache);
|
||||
RedisUtils.setExpire(cacheKey, TagCacheKeyDefine.TAG_NAME);
|
||||
RedisLists.pushJson(cacheKey, cache);
|
||||
RedisLists.setExpire(cacheKey, TagCacheKeyDefine.TAG_NAME);
|
||||
return record.getId();
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class TagServiceImpl implements TagService {
|
||||
public List<TagVO> getTagList(String type) {
|
||||
// 查询缓存
|
||||
String cacheKey = TagCacheKeyDefine.TAG_NAME.format(type);
|
||||
List<TagCacheDTO> cacheValues = RedisUtils.listRangeJson(cacheKey, TagCacheKeyDefine.TAG_NAME);
|
||||
List<TagCacheDTO> cacheValues = RedisLists.rangeJson(cacheKey, TagCacheKeyDefine.TAG_NAME);
|
||||
if (cacheValues.isEmpty()) {
|
||||
// 为空则需要查询缓存
|
||||
LambdaQueryWrapper<TagDO> wrapper = Conditions.eq(TagDO::getType, type);
|
||||
@@ -71,8 +71,8 @@ public class TagServiceImpl implements TagService {
|
||||
cacheValues.add(TagCacheDTO.builder().id(Const.NONE_ID).build());
|
||||
}
|
||||
// 设置到缓存
|
||||
RedisUtils.listPushAllJson(cacheKey, cacheValues);
|
||||
RedisUtils.setExpire(cacheKey, TagCacheKeyDefine.TAG_NAME);
|
||||
RedisLists.pushAllJson(cacheKey, cacheValues);
|
||||
RedisLists.setExpire(cacheKey, TagCacheKeyDefine.TAG_NAME);
|
||||
}
|
||||
// 删除防止穿透的 key
|
||||
cacheValues.removeIf(s -> Const.NONE_ID.equals(s.getId()));
|
||||
@@ -91,7 +91,7 @@ public class TagServiceImpl implements TagService {
|
||||
log.info("TagService-deleteTagById id: {}, effect: {}", id, effect);
|
||||
// 删除缓存
|
||||
String cacheKey = TagCacheKeyDefine.TAG_NAME.format(tag.getType());
|
||||
RedisUtils.listRemoveJson(cacheKey, TagConvert.MAPPER.toCache(tag));
|
||||
RedisLists.removeJson(cacheKey, TagConvert.MAPPER.toCache(tag));
|
||||
return effect;
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ public class TagServiceImpl implements TagService {
|
||||
// 删除缓存
|
||||
for (TagDO tag : tagList) {
|
||||
String cacheKey = TagCacheKeyDefine.TAG_NAME.format(tag.getType());
|
||||
RedisUtils.listRemoveJson(cacheKey, TagConvert.MAPPER.toCache(tag));
|
||||
RedisLists.removeJson(cacheKey, TagConvert.MAPPER.toCache(tag));
|
||||
}
|
||||
return effect;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user