泛微二开系列(十二)根据表名清空缓存

<%@page import="weaver.general.Util"%>
<%@page import="cn.hutool.cache.Cache" %>
<%@page import="cn.hutool.json.JSONObject" %>
<%@page import="cn.hutool.json.XML" %>
<%@ page import="com.alipay.oceanbase.jdbc.StringUtils" %>
<%@ page import="com.wbi.util.ParamUtil" %>
<%@ page import="weaver.hrm.HrmUserVarify" %>
<%@ page import="weaver.hrm.User" %>
<%@ page import="weaver.monitor.cache.CacheFactory" %>
<%@ page import="javax.servlet.http.HttpServletRequest" %>
<%@ page import="javax.servlet.http.HttpServletResponse" %>
<%@ page import="java.util.Map" %>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%

   try{
		String updatetablecache = request.getParameter("updatetablecache");
		String json = "{\"status\":\"error\"}";
		CacheFactory instance = CacheFactory.getInstance();
    
		if (StringUtils.isNotBlank(updatetablecache)) {
			String tkey = updatetablecache.trim().toLowerCase();
			String[] tables = new String[]{tkey};
			instance.removeCache(tables);
		    response.setContentType("application/json");
			
			json = "{\"status\":\"ok\"}";
		}
		out.println(json);
 	} catch (Exception e){
		e.printStackTrace();
		out.println("错误信息"+ e.getMessage()+"<br/>");
	}
	
%>