|
@@ -0,0 +1,34 @@
|
|
|
+package com.malk.mc.controller;
|
|
|
+
|
|
|
+import com.malk.mc.service.McRequestService;
|
|
|
+import com.malk.server.common.VenR;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+@RequestMapping("/request")
|
|
|
+@RestController
|
|
|
+public class McRequestController {
|
|
|
+ @Autowired
|
|
|
+ private McRequestService mcRequestService;
|
|
|
+
|
|
|
+ @PostMapping("/get")
|
|
|
+ public Map get(@RequestBody Map map) {
|
|
|
+ String url = map.get("url").toString();
|
|
|
+ Map headers = (Map) map.get("headers");
|
|
|
+ Map params = (Map) map.get("params");
|
|
|
+
|
|
|
+ return mcRequestService.get(url, headers, params);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/post")
|
|
|
+ public Map post(@RequestBody Map map) {
|
|
|
+ String url = map.get("url").toString();
|
|
|
+ Map headers = (Map) map.get("headers");
|
|
|
+ Map params = (Map) map.get("params");
|
|
|
+ Map body = (Map) map.get("body");
|
|
|
+
|
|
|
+ return mcRequestService.post(url, headers, params, body);
|
|
|
+ }
|
|
|
+}
|