This is an automated email from the ASF dual-hosted git repository.

zhangzicheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu.git


The following commit(s) were added to refs/heads/master by this push:
     new 6e25d0266 [ISSUE #3631]Use path to search. (#3653)
6e25d0266 is described below

commit 6e25d02664d013b731daaf263dbd67152c02b2c5
Author: Zihao Huang <[email protected]>
AuthorDate: Sun Jul 3 12:24:04 2022 +0800

    [ISSUE #3631]Use path to search. (#3653)
---
 .../admin/controller/MetaDataController.java       |  6 ++---
 .../shenyu/admin/model/query/MetaDataQuery.java    | 28 +++++++++++-----------
 .../main/resources/mappers/meta-data-sqlmap.xml    | 10 ++++----
 .../{index.148c9d22.css => index.211ac8ce.css}     |  2 +-
 .../src/main/resources/static/index.607d052d.js    |  1 +
 .../src/main/resources/static/index.b3d851bd.js    |  1 -
 shenyu-admin/src/main/resources/static/index.html  |  4 ++--
 .../admin/controller/MetaDataControllerTest.java   |  4 ++--
 .../shenyu/admin/mapper/MetaDataMapperTest.java    |  4 ++--
 9 files changed, 30 insertions(+), 30 deletions(-)

diff --git 
a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/MetaDataController.java
 
b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/MetaDataController.java
index fea27a92b..8fb4d8bb6 100644
--- 
a/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/MetaDataController.java
+++ 
b/shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/MetaDataController.java
@@ -63,17 +63,17 @@ public class MetaDataController {
     /**
      * Query metadata list.
      *
-     * @param appName     the app name
+     * @param path     the path
      * @param currentPage the current page
      * @param pageSize    the page size
      * @return the shenyu result
      */
     @GetMapping("/queryList")
     @RequiresPermissions("system:meta:list")
-    public ShenyuAdminResult queryList(final String appName,
+    public ShenyuAdminResult queryList(final String path,
                                        @RequestParam @NotNull(message = 
"currentPage not null") final Integer currentPage,
                                        @RequestParam @NotNull(message = 
"pageSize not null") final Integer pageSize) {
-        CommonPager<MetaDataVO> commonPager = metaDataService.listByPage(new 
MetaDataQuery(appName, new PageParameter(currentPage, pageSize)));
+        CommonPager<MetaDataVO> commonPager = metaDataService.listByPage(new 
MetaDataQuery(path, new PageParameter(currentPage, pageSize)));
         return ShenyuAdminResult.success(ShenyuResultMessage.QUERY_SUCCESS, 
commonPager);
     }
 
diff --git 
a/shenyu-admin/src/main/java/org/apache/shenyu/admin/model/query/MetaDataQuery.java
 
b/shenyu-admin/src/main/java/org/apache/shenyu/admin/model/query/MetaDataQuery.java
index ad49a0e00..335755627 100644
--- 
a/shenyu-admin/src/main/java/org/apache/shenyu/admin/model/query/MetaDataQuery.java
+++ 
b/shenyu-admin/src/main/java/org/apache/shenyu/admin/model/query/MetaDataQuery.java
@@ -30,9 +30,9 @@ public class MetaDataQuery implements Serializable {
     private static final long serialVersionUID = -8342574521635216117L;
 
     /**
-     * application key.
+     * path parameter.
      */
-    private String appName;
+    private String path;
 
     /**
      * page parameter.
@@ -42,27 +42,27 @@ public class MetaDataQuery implements Serializable {
     public MetaDataQuery() {
     }
 
-    public MetaDataQuery(final String appName, final PageParameter 
pageParameter) {
-        this.appName = appName;
+    public MetaDataQuery(final String path, final PageParameter pageParameter) 
{
+        this.path = path;
         this.pageParameter = pageParameter;
     }
 
     /**
-     * Gets the value of appName.
+     * Gets the value of path.
      *
-     * @return the value of appName
+     * @return the value of path
      */
-    public String getAppName() {
-        return appName;
+    public String getPath() {
+        return path;
     }
 
     /**
-     * Sets the appName.
+     * Sets the path.
      *
-     * @param appName appName
+     * @param path path
      */
-    public void setAppName(final String appName) {
-        this.appName = appName;
+    public void setPath(final String path) {
+        this.path = path;
     }
 
     /**
@@ -92,11 +92,11 @@ public class MetaDataQuery implements Serializable {
             return false;
         }
         MetaDataQuery that = (MetaDataQuery) o;
-        return Objects.equals(appName, that.appName) && 
Objects.equals(pageParameter, that.pageParameter);
+        return Objects.equals(path, that.path) && 
Objects.equals(pageParameter, that.pageParameter);
     }
 
     @Override
     public int hashCode() {
-        return Objects.hash(appName, pageParameter);
+        return Objects.hash(path, pageParameter);
     }
 }
diff --git a/shenyu-admin/src/main/resources/mappers/meta-data-sqlmap.xml 
b/shenyu-admin/src/main/resources/mappers/meta-data-sqlmap.xml
index 2f9399edd..4a62335da 100644
--- a/shenyu-admin/src/main/resources/mappers/meta-data-sqlmap.xml
+++ b/shenyu-admin/src/main/resources/mappers/meta-data-sqlmap.xml
@@ -92,17 +92,17 @@
         SElECT
                 <include refid="Base_Column_List"/>
           FROM meta_data
-                <if test="appName != null and appName != ''">
-                    <bind name="appNameLike" value="('%' + appName + '%')"/>
-                        WHERE app_name LIKE #{appNameLike,jdbcType=VARCHAR}
+                <if test="path != null and path != ''">
+                    <bind name="pathLike" value="('%' + path + '%')"/>
+                        WHERE path LIKE #{pathLike,jdbcType=VARCHAR}
                 </if>
     </select>
 
     <select id="countByQuery" 
parameterType="org.apache.shenyu.admin.model.query.MetaDataQuery" 
resultType="java.lang.Integer">
         SElECT COUNT(1)
           FROM meta_data
-                <if test="appName != null">
-                    WHERE app_name = #{appName,jdbcType=VARCHAR}
+                <if test="path != null">
+                    WHERE path = #{path,jdbcType=VARCHAR}
                 </if>
     </select>
 
diff --git a/shenyu-admin/src/main/resources/static/index.148c9d22.css 
b/shenyu-admin/src/main/resources/static/index.211ac8ce.css
similarity index 99%
rename from shenyu-admin/src/main/resources/static/index.148c9d22.css
rename to shenyu-admin/src/main/resources/static/index.211ac8ce.css
index 146b72acd..d6a1c550a 100644
--- a/shenyu-admin/src/main/resources/static/index.148c9d22.css
+++ b/shenyu-admin/src/main/resources/static/index.211ac8ce.css
@@ -7,4 +7,4 @@
  * All rights reserved.
  *       
  
*/body,html{width:100%;height:100%}input::-ms-clear,input::-ms-reveal{display:none}*,:after,:before{-webkit-box-sizing:border-box;box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}@-ms-viewport{width:device-width}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;color:rgba(0,0,0,.65);font-si
 [...]
-  /*! autoprefixer: ignore next 
*/-webkit-box-orient:vertical;overflow:hidden}.ant-upload{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum";outline:0}.ant-upload
 p{margin:0}.ant-upload-btn{display:block;width:100%;outline:none}.ant-upload 
input[type=file]{cursor:pointer}.ant-upload.ant-upload-select{display:i [...]
\ No newline at end of file
+  /*! autoprefixer: ignore next 
*/-webkit-box-orient:vertical;overflow:hidden}.ant-upload{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.65);font-size:14px;font-variant:tabular-nums;line-height:1.5;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum";outline:0}.ant-upload
 p{margin:0}.ant-upload-btn{display:block;width:100%;outline:none}.ant-upload 
input[type=file]{cursor:pointer}.ant-upload.ant-upload-select{display:i [...]
\ No newline at end of file
diff --git a/shenyu-admin/src/main/resources/static/index.607d052d.js 
b/shenyu-admin/src/main/resources/static/index.607d052d.js
new file mode 100644
index 000000000..3feea7e69
--- /dev/null
+++ b/shenyu-admin/src/main/resources/static/index.607d052d.js
@@ -0,0 +1 @@
+!function(e){function t(r){if(n[r])return n[r].exports;var 
o=n[r]={i:r,l:!1,exports:{}};return 
e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var 
n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var
 n=e&&e.__esModule?function(){return e.default}:function(){return e};return 
t.d(n,"a",n),n},t.o=function(e,t){return 
Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s="lVK7")}({"+0it":function(e,t,n){"u
 [...]
\ No newline at end of file
diff --git a/shenyu-admin/src/main/resources/static/index.b3d851bd.js 
b/shenyu-admin/src/main/resources/static/index.b3d851bd.js
deleted file mode 100644
index b1aa6a786..000000000
--- a/shenyu-admin/src/main/resources/static/index.b3d851bd.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(e){function t(r){if(n[r])return n[r].exports;var 
o=n[r]={i:r,l:!1,exports:{}};return 
e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var 
n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var
 n=e&&e.__esModule?function(){return e.default}:function(){return e};return 
t.d(n,"a",n),n},t.o=function(e,t){return 
Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s="lVK7")}({"+0it":function(e,t,n){"u
 [...]
\ No newline at end of file
diff --git a/shenyu-admin/src/main/resources/static/index.html 
b/shenyu-admin/src/main/resources/static/index.html
index 77aead23d..529bba7bd 100644
--- a/shenyu-admin/src/main/resources/static/index.html
+++ b/shenyu-admin/src/main/resources/static/index.html
@@ -23,12 +23,12 @@
     <meta name="viewport" content="width=device-width, initial-scale=1" />
     <title>Apache ShenYu Gateway</title>
     <link rel="icon" href="/favicon.ico" type="image/x-icon" />
-    <link href="/index.148c9d22.css" rel="stylesheet" />
+    <link href="/index.211ac8ce.css" rel="stylesheet" />
   </head>
 
   <body>
     <div id="httpPath" style="display: none" th:text="${domain}"></div>
     <div id="root"></div>
-    <script type="text/javascript" src="/index.b3d851bd.js"></script>
+    <script type="text/javascript" src="/index.607d052d.js"></script>
   </body>
 </html>
diff --git 
a/shenyu-admin/src/test/java/org/apache/shenyu/admin/controller/MetaDataControllerTest.java
 
b/shenyu-admin/src/test/java/org/apache/shenyu/admin/controller/MetaDataControllerTest.java
index a13727102..2767a4bf5 100644
--- 
a/shenyu-admin/src/test/java/org/apache/shenyu/admin/controller/MetaDataControllerTest.java
+++ 
b/shenyu-admin/src/test/java/org/apache/shenyu/admin/controller/MetaDataControllerTest.java
@@ -97,10 +97,10 @@ public final class MetaDataControllerTest {
         final CommonPager<MetaDataVO> commonPager = new CommonPager<>();
         commonPager.setPage(pageParameter);
         commonPager.setDataList(metaDataVOS);
-        final MetaDataQuery metaDataQuery = new MetaDataQuery("appName", 
pageParameter);
+        final MetaDataQuery metaDataQuery = new MetaDataQuery("path", 
pageParameter);
         
given(this.metaDataService.listByPage(metaDataQuery)).willReturn(commonPager);
         this.mockMvc.perform(MockMvcRequestBuilders.get("/meta-data/queryList")
-                .param("appName", "appName")
+                .param("path", "path")
                 .param("currentPage", pageParameter.getCurrentPage() + "")
                 .param("pageSize", pageParameter.getPageSize() + ""))
                 .andExpect(status().isOk())
diff --git 
a/shenyu-admin/src/test/java/org/apache/shenyu/admin/mapper/MetaDataMapperTest.java
 
b/shenyu-admin/src/test/java/org/apache/shenyu/admin/mapper/MetaDataMapperTest.java
index 8409027e0..b3d4c55fe 100644
--- 
a/shenyu-admin/src/test/java/org/apache/shenyu/admin/mapper/MetaDataMapperTest.java
+++ 
b/shenyu-admin/src/test/java/org/apache/shenyu/admin/mapper/MetaDataMapperTest.java
@@ -120,7 +120,7 @@ public final class MetaDataMapperTest extends 
AbstractSpringIntegrationTest {
         assertThat(count, comparesEqualTo(1));
 
         MetaDataQuery metaDataQuery = new MetaDataQuery();
-        metaDataQuery.setAppName(metaDataDO.getAppName());
+        metaDataQuery.setPath(metaDataDO.getPath());
         metaDataQuery.setPageParameter(new PageParameter());
 
         List<MetaDataDO> result = metaDataMapper.selectByQuery(metaDataQuery);
@@ -146,7 +146,7 @@ public final class MetaDataMapperTest extends 
AbstractSpringIntegrationTest {
         assertThat(count, comparesEqualTo(1));
 
         MetaDataQuery metaDataQuery = new MetaDataQuery();
-        metaDataQuery.setAppName(metaDataDO.getAppName());
+        metaDataQuery.setPath(metaDataDO.getPath());
         metaDataQuery.setPageParameter(new PageParameter());
 
         count = metaDataMapper.countByQuery(metaDataQuery);

Reply via email to