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

kevinclair 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 7171063  [type: refactor] Modify local model controller (#2152)
7171063 is described below

commit 71710631abb463829a373f5f552a5015984d1cf1
Author: xiaoyu <[email protected]>
AuthorDate: Mon Sep 27 17:54:44 2021 +0800

    [type: refactor] Modify local model controller (#2152)
---
 .../main/java/org/apache/shenyu/common/dto/AppAuthData.java    |  2 --
 .../apache/shenyu/web/controller/LocalAppAuthController.java   | 10 +++++-----
 .../apache/shenyu/web/controller/LocalMetadataController.java  |  8 ++++++--
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git 
a/shenyu-common/src/main/java/org/apache/shenyu/common/dto/AppAuthData.java 
b/shenyu-common/src/main/java/org/apache/shenyu/common/dto/AppAuthData.java
index bbd830b..e3ab6b3 100644
--- a/shenyu-common/src/main/java/org/apache/shenyu/common/dto/AppAuthData.java
+++ b/shenyu-common/src/main/java/org/apache/shenyu/common/dto/AppAuthData.java
@@ -27,8 +27,6 @@ import java.util.Objects;
  */
 public class AppAuthData {
 
-    private static final long serialVersionUID = -7060944416765128601L;
-
     private String appKey;
 
     private String appSecret;
diff --git 
a/shenyu-web/src/main/java/org/apache/shenyu/web/controller/LocalAppAuthController.java
 
b/shenyu-web/src/main/java/org/apache/shenyu/web/controller/LocalAppAuthController.java
index 003010d..9b0f0b3 100644
--- 
a/shenyu-web/src/main/java/org/apache/shenyu/web/controller/LocalAppAuthController.java
+++ 
b/shenyu-web/src/main/java/org/apache/shenyu/web/controller/LocalAppAuthController.java
@@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import reactor.core.publisher.Mono;
 
@@ -55,19 +56,18 @@ public class LocalAppAuthController {
     }
     
     /**
-     * Clean AppAuth data by appKey.
+     * Clean mono.
      *
-     * @param appKey the appKey
+     * @param appKey the app key
      * @return the mono
      */
     @GetMapping("/auth/delete")
-    public Mono<String> clean(final String appKey) {
+    public Mono<String> clean(@RequestParam("appKey") final String appKey) {
         if (CollectionUtils.isEmpty(subscribers)) {
             return Mono.just(Constants.SUCCESS);
         }
         LOG.info("delete apache shenyu local AppAuth data");
-        AppAuthData appAuthData = new AppAuthData();
-        appAuthData.setAppKey(appKey);
+        AppAuthData appAuthData = AppAuthData.builder().appKey(appKey).build();
         subscribers.forEach(authDataSubscriber -> 
authDataSubscriber.unSubscribe(appAuthData));
         return Mono.just(Constants.SUCCESS);
     }
diff --git 
a/shenyu-web/src/main/java/org/apache/shenyu/web/controller/LocalMetadataController.java
 
b/shenyu-web/src/main/java/org/apache/shenyu/web/controller/LocalMetadataController.java
index aee02f7..c88efc2 100644
--- 
a/shenyu-web/src/main/java/org/apache/shenyu/web/controller/LocalMetadataController.java
+++ 
b/shenyu-web/src/main/java/org/apache/shenyu/web/controller/LocalMetadataController.java
@@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import reactor.core.publisher.Mono;
 
@@ -57,15 +58,18 @@ public class LocalMetadataController {
     /**
      * Clean mono.
      *
-     * @param metaData the meta data
+     * @param rpcType the rpc type
+     * @param path the path
      * @return the mono
      */
     @GetMapping("/meta/delete")
-    public Mono<String> clean(final MetaData metaData) {
+    public Mono<String> clean(@RequestParam("rpcType") final String rpcType,
+                              @RequestParam("path") final String path) {
         if (CollectionUtils.isEmpty(subscribers)) {
             return Mono.just(Constants.SUCCESS);
         }
         LOG.info("delete apache shenyu local meta data");
+        MetaData metaData = 
MetaData.builder().rpcType(rpcType).path(path).build();
         subscribers.forEach(metaDataSubscriber -> 
metaDataSubscriber.unSubscribe(metaData));
         return Mono.just(Constants.SUCCESS);
     }

Reply via email to