GrayNginxSwitchCtrl.java
1.4 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
54
55
package com.ui.ctrl;
import com.ui.http.HttpRestClient;
import com.ui.model.BaseResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import java.util.HashMap;
import java.util.Map;
/**
* 灰度的nginx切换
*
* @author craig.qin 2018-1-10
*/
@Controller
@RequestMapping("/grayNginxSwitch")
public class GrayNginxSwitchCtrl {
@Autowired
HttpRestClient httpRestClient;
@RequestMapping(value = "/toGrayNginxSwitch")
public ModelAndView toGrayNginxSwitch() {
ModelAndView mdv = new ModelAndView("switch/switch_nginx_gray");
return mdv;
}
/**
* 展示配置文件信息
*
*/
@RequestMapping(value = "/viewGrayNginxCurrentConf")
@ResponseBody
public BaseResponse viewGrayNginxCurrentConf() {
return httpRestClient.defaultGet( "/grayNginxSwitch/viewGrayNginxCurrentConf", BaseResponse.class, null);
}
/**
* 解析当前配置,绘图用
*
*/
@RequestMapping(value = "/getGrayNginxStatus")
@ResponseBody
public BaseResponse getGrayNginxStatus() {
return httpRestClient.defaultGet( "/grayNginxSwitch/getGrayNginxStatus", BaseResponse.class, null);
}
}