ApiInfoController.java
1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package com.zhaoonline.support.gateway.web;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.zhaoonline.support.gateway.apijar.ApiResponse;
import com.zhaoonline.support.gateway.service.ServiceInfo;
import com.zhaoonline.support.gateway.web.service.APIInfoService;
@Controller
@RequestMapping("/apiInfo")
public class ApiInfoController {
@Autowired APIInfoService apiInfoService;
@GetMapping("/queryAll")
@ResponseBody
public ApiResponse queryAll(Map<String, Object> model) {
ApiResponse response=apiInfoService.queryAllServiceInfo();
return response;
}
@GetMapping("/delete/{serviceID}")
@ResponseBody
public ApiResponse delete(@PathVariable String serviceID) {
ApiResponse response=apiInfoService.deleteServiceInfoByID(serviceID);
return response;
}
@RequestMapping(path="/add",method=RequestMethod.POST)
public ApiResponse add(@RequestBody ServiceInfo serviceInfo) {
ApiResponse response=apiInfoService.addServiceInfo(serviceInfo);
//ApiResponse response=apiInfoService.deleteServiceInfoByID(serviceID);
//return response;
return response;
}
@RequestMapping(path="/addtest",method=RequestMethod.POST)
public ApiResponse add(@RequestBody String serviceInfo) {
// ApiResponse response=apiInfoService.addServiceInfo(serviceInfo);
//ApiResponse response=apiInfoService.deleteServiceInfoByID(serviceID);
//return response;
return null;
}
}