Explorar el Código

修改sls/view接口传值模式

luoshi hace 5 años
padre
commit
056da754b0

+ 8 - 5
src/main/java/com/qmth/ops/aliyun/controller/SlsController.java

@@ -3,9 +3,10 @@ package com.qmth.ops.aliyun.controller;
 import com.qmth.ops.aliyun.utils.SlsService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.server.ServerWebExchange;
 import reactor.core.publisher.Mono;
 
 /**
@@ -13,7 +14,7 @@ import reactor.core.publisher.Mono;
  * @date 2019/3/23 09:54
  */
 @RestController
-@RequestMapping("/sls")
+@RequestMapping("/api/sls")
 @CrossOrigin
 public class SlsController {
 
@@ -25,8 +26,10 @@ public class SlsController {
         return Mono.just(slsService.getProject());
     }
 
-    @RequestMapping("/view")
-    public Mono<String> view(@RequestParam String project, @RequestParam String store) {
-        return slsService.view(project, store);
+    @PostMapping("/view")
+    public Mono<String> view(ServerWebExchange exchange) {
+        return exchange.getFormData().flatMap(form -> {
+            return slsService.view(form.getFirst("project"), form.getFirst("store"));
+        });
     }
 }