<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ``` /** * @author 張躍帥 * @Description: 系統配置-redis緩存 * @date 2020/08/12 */ public class SystemConfigRedisCache { /** * 系統配置-Service */ private static final SystemConfigService systemConfigService = SpringUtil.getBean(SystemConfigService.class); /** * 根據key獲取val */ public static String getValByKey(String key) { // 變量 String val = null; // 獲取參數 String appCode = SystemMe.getUserAppCode(); // 判斷 if (StrUtil.isNotBlank(key)) { // redis緩存-獲取 String cacheValStr = RedisCacheUtil.getToStr(CacheConstant.WEB_CACHE_PREFIX + appCode + ":" + key); // 判斷 if (StrUtil.isNotBlank(cacheValStr)) { // 賦值 val = cacheValStr; } else { // 創建條件查詢包裝器 LambdaQueryWrapper<SystemConfigEntity> queryWrapper = new LambdaQueryWrapper<>(); // 設置條件 queryWrapper.eq(SystemConfigEntity::getAppCode, appCode) .eq(SystemConfigEntity::getKey, key) .eq(SystemConfigEntity::getDataFlag, CommonDataFlagEnum.NORMAL.getCode()) .eq(SystemConfigEntity::getDelFlag, CommonDelFlagEnum.NOT_DELETE.getCode()); // 查詢 SystemConfigEntity systemConfig = systemConfigService.getOne(queryWrapper); // 判斷 if (ObjectUtil.isNotNull(systemConfig)) { // 獲取參數 String cahcheAppCode = systemConfig.getAppCode(); String cahcheKey = systemConfig.getKey(); String cacheVal = systemConfig.getVal(); // 判斷 if (StrUtil.isNotBlank(cahcheAppCode) && StrUtil.isNotBlank(cahcheKey) && StrUtil.isNotBlank(cacheVal)) { // 賦值 val = cacheVal; // redis緩存-存入 RedisCacheUtil.put(CacheConstant.WEB_CACHE_PREFIX + cahcheAppCode + ":" + cahcheKey, cacheVal); } } } } // 返回 return val; } /** * 添加 */ public static void put(String appCode, String key, String value) { // 判斷 if (StrUtil.isNotBlank(appCode) && StrUtil.isNotBlank(key) && StrUtil.isNotBlank(value)) { // redis緩存 RedisCacheUtil.put(CacheConstant.WEB_CACHE_PREFIX + appCode + ":" + key, value); } } /** * 添加所有 */ public static void putAll(List<SystemConfigEntity> systemConfigList) { // 判斷 if (systemConfigList != null && systemConfigList.size() > 0) { // 遍歷 for (SystemConfigEntity systemConfig : systemConfigList) { // 獲取參數 String cahcheAppCode = systemConfig.getAppCode(); String cacheKey = systemConfig.getKey(); String cacheVal = systemConfig.getVal(); // 判斷 if (StrUtil.isNotBlank(cahcheAppCode) && StrUtil.isNotBlank(cacheKey) && StrUtil.isNotBlank(cacheVal)) { // redis緩存 RedisCacheUtil.put(CacheConstant.WEB_CACHE_PREFIX + cahcheAppCode + ":" + cacheKey, cacheVal); } } } } /** * 更新 */ public static void upValByKey(String appCode, String key, String newVal) { // 判斷 if (StrUtil.isNotBlank(appCode) && StrUtil.isNotBlank(key) && StrUtil.isNotBlank(newVal)) { // 先刪除 delByKey(appCode, key); // 在添加 put(appCode, key, newVal); } } /** * 刪除 */ public static void delByKey(String appCode, String key) { // 判斷 if (StrUtil.isNotBlank(appCode) && StrUtil.isNotBlank(key)) { // redis緩存 RedisCacheUtil.remove(appCode, key); } } }
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看