admin
2020-10-22 cba071db4529097598095e2971949dfd109f12b9
src/main/java/com/yeshi/buwan/controller/admin/api/ConfigController.java
@@ -5,6 +5,9 @@
import javax.annotation.Resource;
import com.yeshi.buwan.util.EHCacheManager;
import com.yeshi.buwan.util.JsonUtil;
import com.yeshi.buwan.util.StringUtil;
import com.yeshi.buwan.util.SystemUtil;
import org.json.JSONArray;
import org.json.JSONObject;
@@ -20,6 +23,9 @@
public class ConfigController {
    @Resource
    private ConfigService configService;
    @Resource
    private EHCacheManager ehCacheManager;
    @RequestMapping("configList")
    public void configList(PrintWriter out) {
@@ -60,4 +66,22 @@
        return;
    }
    /**
     * 清除缓存
     *
     * @param cache
     * @param out
     */
    @RequestMapping(value = "clearCache", method = RequestMethod.POST)
    public void clearCache(String cache, PrintWriter out) {
        //清除全部缓存
        if (StringUtil.isNullOrEmpty(cache)) {
            ehCacheManager.removeAllCache();
        } else {
            ehCacheManager.clearCacheByCacheName(cache);
        }
        out.print(JsonUtil.loadTrueAdmin(""));
        return;
    }
}