|
@@ -10,18 +10,22 @@ import com.dgtly.common.core.domain.Ztree;
|
|
|
import com.dgtly.common.core.page.TableDataInfo;
|
|
import com.dgtly.common.core.page.TableDataInfo;
|
|
|
import com.dgtly.common.enums.BusinessType;
|
|
import com.dgtly.common.enums.BusinessType;
|
|
|
import com.dgtly.common.exception.BusinessException;
|
|
import com.dgtly.common.exception.BusinessException;
|
|
|
|
|
+import com.dgtly.common.utils.StringUtils;
|
|
|
import com.dgtly.framework.util.ShiroUtils;
|
|
import com.dgtly.framework.util.ShiroUtils;
|
|
|
import com.dgtly.system.domain.SysRole;
|
|
import com.dgtly.system.domain.SysRole;
|
|
|
import com.dgtly.system.domain.SysUser;
|
|
import com.dgtly.system.domain.SysUser;
|
|
|
import com.dgtly.wxportal.domain.HomeIconConfig;
|
|
import com.dgtly.wxportal.domain.HomeIconConfig;
|
|
|
|
|
+import com.dgtly.wxportal.domain.RedisDbParam;
|
|
|
import com.dgtly.wxportal.domain.WxMagnet;
|
|
import com.dgtly.wxportal.domain.WxMagnet;
|
|
|
import com.dgtly.wxportal.service.IWxMagnetService;
|
|
import com.dgtly.wxportal.service.IWxMagnetService;
|
|
|
|
|
+import com.dgtly.wxportal.utils.JedisPoolUtil;
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.ui.ModelMap;
|
|
import org.springframework.ui.ModelMap;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
+import redis.clients.jedis.Jedis;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -206,6 +210,34 @@ public class WxMagnetController extends BaseController
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ @Log(title = "redis缓存清除", businessType = BusinessType.UPDATE)
|
|
|
|
|
+ @PostMapping("/cleanRedisByDb")
|
|
|
|
|
+ @ResponseBody
|
|
|
|
|
+ public AjaxResult cleanRedisByDb(@RequestBody RedisDbParam redisDbParam)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if(redisDbParam.getRedisDb().length==0){
|
|
|
|
|
+ return AjaxResult.error(201,"redis库未指定!");
|
|
|
|
|
+ }
|
|
|
|
|
+ for (int db : redisDbParam.getRedisDb()) {
|
|
|
|
|
+ try (Jedis jedis = JedisPoolUtil.getResource()) {
|
|
|
|
|
+ jedis.select(db);
|
|
|
|
|
+ if(StringUtils.isNotBlank(redisDbParam.getKeyName())){
|
|
|
|
|
+ jedis.del(redisDbParam.getKeyName());
|
|
|
|
|
+ log.info("清空库" + db+"下的"+redisDbParam.getKeyName());
|
|
|
|
|
+ }
|
|
|
|
|
+ else{
|
|
|
|
|
+ jedis.flushDB();
|
|
|
|
|
+ log.info("清空库" + db);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return AjaxResult.success("200","操作成功!");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 加载角色磁贴列表树
|
|
* 加载角色磁贴列表树
|
|
|
*/
|
|
*/
|