Pārlūkot izejas kodu

缓存清理修改

yanym 4 mēneši atpakaļ
vecāks
revīzija
fccf83d356

+ 28 - 0
suishenbang-admin/src/main/java/com/dgtly/web/controller/monitor/clearStorageController.java

@@ -0,0 +1,28 @@
+package com.dgtly.web.controller.monitor;
+
+import com.dgtly.common.core.controller.BaseController;
+import com.dgtly.framework.web.domain.Server;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+/**
+ * 缓存清理
+ * 
+ * @author ruoyi
+ */
+@Controller
+@RequestMapping("/monitor/clearStorage")
+public class clearStorageController extends BaseController
+{
+    private String prefix = "monitor/clearStorage";
+
+    @RequiresPermissions("monitor:clearStorage:view")
+    @GetMapping()
+    public String clearStorage()
+    {
+        return prefix + "/clearStorage";
+    }
+}

+ 94 - 0
suishenbang-admin/src/main/resources/templates/monitor/clearStorage/clearStorage.html

@@ -0,0 +1,94 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('缓存清理')" />
+</head>
+<body class="gray-bg">
+<div class="wrapper wrapper-content">
+    <div class="col-sm-12">
+        <div class="row">
+            <label class="col-sm-1 control-label"></label>
+            <div class="col-sm-10">
+                <label class="check-box">
+                    <input type="checkbox" value="0" id="inlineCheckbox0" name="checkboxGroupName">0</label>
+                <label class="check-box">
+                    <input type="checkbox" value="1" id="inlineCheckbox1" name="checkboxGroupName">1</label>
+                <label class="check-box">
+                    <input type="checkbox" value="2" id="inlineCheckbox2" name="checkboxGroupName">2</label>
+                <label class="check-box">
+                    <input type="checkbox" value="3" id="inlineCheckbox3" name="checkboxGroupName">3</label>
+                <label class="check-box">
+                    <input type="checkbox" value="4" id="inlineCheckbox4" name="checkboxGroupName">4</label>
+                <label class="check-box">
+                    <input type="checkbox" value="5" id="inlineCheckbox5" name="checkboxGroupName">5</label>
+                <label class="check-box">
+                    <input type="checkbox" value="6" id="inlineCheckbox6" name="checkboxGroupName">6</label>
+                <label class="check-box">
+                    <input type="checkbox" value="7" id="inlineCheckbox7" name="checkboxGroupName">7</label>
+                <label class="check-box">
+                    <input type="checkbox" value="8" id="inlineCheckbox8" name="checkboxGroupName">8</label>
+                <label class="check-box">
+                    <input type="checkbox" value="9" id="inlineCheckbox9" name="checkboxGroupName">9</label>
+                <label class="check-box">
+                    <input type="checkbox" value="10" id="inlineCheckbox10" name="checkboxGroupName">10</label>
+                <label class="check-box">
+                    <input type="checkbox" value="11" id="inlineCheckbox11" name="checkboxGroupName">11</label>
+                <label class="check-box">
+                    <input type="checkbox" value="12" id="inlineCheckbox12" name="checkboxGroupName">12</label>
+                <label class="check-box">
+                    <input type="checkbox" value="13" id="inlineCheckbox13" name="checkboxGroupName">13</label>
+                <label class="check-box">
+                    <input type="checkbox" value="14" id="inlineCheckbox14" name="checkboxGroupName">14</label>
+                <label class="check-box">
+                    <input type="checkbox" value="15" id="inlineCheckbox15" name="checkboxGroupName">15</label>
+            </div>
+        </div>
+        <div class="row" style="margin-top: 10px;">
+            <label class="col-sm-1 control-label" style="text-align: right;padding: 0;">清空单体:</label>
+            <div class="col-sm-8">
+                <input type="text" id="keyName" name="" class="form-control" placeholder="">
+            </div>
+        </div>
+        <div class="row" style="margin-top: 10px;">
+            <label class="col-sm-1 control-label"></label>
+            <button id="applyBtn" class="btn btn-success">
+                提交
+            </button>
+        </div>
+    </div>
+</div>
+</body>
+<th:block th:include="include :: footer" />
+<script type="text/javascript">
+    var domain = window.location.host;
+    var ht = domain.indexOf('localhost') != -1 ? 'http://' : 'https://';
+    var prefixEdit = ht + domain + "/oneportal/wxportal/magnet";
+    // var prefixEdit = 'https://suishenbangtest.nipponpaint.com.cn/oneportal/wxportal/magnet';
+
+    $('#applyBtn').on('click', function (res) {
+        var selectedValues = [];
+        $('input[name="checkboxGroupName"]:checked').each(function() {
+            selectedValues.push($(this).val()*1);
+        });
+        var keyNameValue = $('#keyName').val();
+        var data = {
+            redisDb:selectedValues,
+            keyName:keyNameValue
+        }
+        console.log(1,data);
+        $.ajax({
+            url: prefixEdit + '/cleanRedisByDb',
+            type: "post",
+            contentType: 'application/json',
+            data: JSON.stringify(data),
+            success: function (result) {
+                if (result.code == 0) {
+                    $.modal.alertWarning('提交成功');
+                } else {
+                    $.modal.alertWarning(result.msg);
+                }
+            }
+        })
+    })
+</script>
+</html>

+ 5 - 0
suishenbang-wxportal/suishenbang-wxportal-manager/pom.xml

@@ -44,6 +44,11 @@
             <groupId>com.dgtly</groupId>
             <artifactId>suishenbang-system</artifactId>
         </dependency>
+        <dependency>
+            <groupId>redis.clients</groupId>
+            <artifactId>jedis</artifactId>
+            <version>5.0.2</version>
+        </dependency>
 
 
     </dependencies>