Showing
4 changed files
with
49 additions
and
36 deletions
@@ -13,7 +13,6 @@ import org.springframework.web.bind.annotation.ResponseBody; | @@ -13,7 +13,6 @@ import org.springframework.web.bind.annotation.ResponseBody; | ||
13 | import org.springframework.web.servlet.ModelAndView; | 13 | import org.springframework.web.servlet.ModelAndView; |
14 | 14 | ||
15 | import java.util.HashMap; | 15 | import java.util.HashMap; |
16 | -import java.util.List; | ||
17 | import java.util.Map; | 16 | import java.util.Map; |
18 | 17 | ||
19 | /** | 18 | /** |
@@ -31,7 +30,9 @@ public class LbSwitchCtrl { | @@ -31,7 +30,9 @@ public class LbSwitchCtrl { | ||
31 | HttpRestClient httpRestClient; | 30 | HttpRestClient httpRestClient; |
32 | 31 | ||
33 | /** | 32 | /** |
34 | - * @return | 33 | + * 展示当前配置 |
34 | + * | ||
35 | + * @return ModelAndView | ||
35 | */ | 36 | */ |
36 | @RequestMapping(value = "toLbSwitch") | 37 | @RequestMapping(value = "toLbSwitch") |
37 | public ModelAndView viewNginxConf() { | 38 | public ModelAndView viewNginxConf() { |
@@ -45,27 +46,28 @@ public class LbSwitchCtrl { | @@ -45,27 +46,28 @@ public class LbSwitchCtrl { | ||
45 | } | 46 | } |
46 | 47 | ||
47 | /** | 48 | /** |
48 | - * 修改配置 | 49 | + * 展示修改后的配置文件内容 |
49 | * | 50 | * |
50 | - * @return 2016年5月12日下午1:49:48 | 51 | + * @param status 状态:1-开启;2-关闭 |
52 | + * @return BaseResponse | ||
51 | */ | 53 | */ |
52 | @RequestMapping(value = "viewToChangeLbConf") | 54 | @RequestMapping(value = "viewToChangeLbConf") |
53 | @ResponseBody | 55 | @ResponseBody |
54 | public BaseResponse viewToChangeLbConf(String status) { | 56 | public BaseResponse viewToChangeLbConf(String status) { |
55 | - Map map = new HashMap<>(); | 57 | + Map<String, Object> map = new HashMap<>(); |
56 | map.put("status", status); | 58 | map.put("status", status); |
57 | return httpRestClient.defaultGet(HttpUriContants.VIEW_TOCHANGE_LB_CONF, BaseResponse.class, map); | 59 | return httpRestClient.defaultGet(HttpUriContants.VIEW_TOCHANGE_LB_CONF, BaseResponse.class, map); |
58 | } | 60 | } |
59 | 61 | ||
60 | /** | 62 | /** |
61 | - * 修改配置 | 63 | + * 修改配置,并重启nginx |
62 | * | 64 | * |
63 | - * @return 2016年5月12日下午1:49:48 | 65 | + * @return BaseResponse |
64 | */ | 66 | */ |
65 | @RequestMapping(value = "switchConf") | 67 | @RequestMapping(value = "switchConf") |
66 | @ResponseBody | 68 | @ResponseBody |
67 | public BaseResponse switchConf() { | 69 | public BaseResponse switchConf() { |
68 | - Map map = new HashMap<>(); | 70 | + Map<String, Object> map = new HashMap<>(); |
69 | return httpRestClient.defaultGet(HttpUriContants.SWITCH_LB, BaseResponse.class, map); | 71 | return httpRestClient.defaultGet(HttpUriContants.SWITCH_LB, BaseResponse.class, map); |
70 | } | 72 | } |
71 | 73 |
@@ -30,9 +30,9 @@ public class LimitSwitchCtrl { | @@ -30,9 +30,9 @@ public class LimitSwitchCtrl { | ||
30 | HttpRestClient httpRestClient; | 30 | HttpRestClient httpRestClient; |
31 | 31 | ||
32 | /** | 32 | /** |
33 | - * 查看nginx配置 | 33 | + * 展示当前配置 |
34 | * | 34 | * |
35 | - * @return 2016年5月12日下午1:49:48 | 35 | + * @return ModelAndView |
36 | */ | 36 | */ |
37 | @RequestMapping(value = "toLimitSwitch") | 37 | @RequestMapping(value = "toLimitSwitch") |
38 | public ModelAndView viewNginxConf() { | 38 | public ModelAndView viewNginxConf() { |
@@ -48,14 +48,17 @@ public class LimitSwitchCtrl { | @@ -48,14 +48,17 @@ public class LimitSwitchCtrl { | ||
48 | } | 48 | } |
49 | 49 | ||
50 | /** | 50 | /** |
51 | - * 修改配置 | 51 | + * 展示修改后配置文件内容 |
52 | * | 52 | * |
53 | - * @return 2016年5月12日下午1:49:48 | 53 | + * @param openLimitFlow 限流开关true/false |
54 | + * @param limitConfig api接口限流配置 | ||
55 | + * @param limitServiceConfig service接口限流配置 | ||
56 | + * @return BaseResponse | ||
54 | */ | 57 | */ |
55 | @RequestMapping(value = "viewToChangeLimitConf") | 58 | @RequestMapping(value = "viewToChangeLimitConf") |
56 | @ResponseBody | 59 | @ResponseBody |
57 | public BaseResponse viewToChangeLimitConf(String openLimitFlow, String limitConfig, String limitServiceConfig) { | 60 | public BaseResponse viewToChangeLimitConf(String openLimitFlow, String limitConfig, String limitServiceConfig) { |
58 | - Map map = new HashMap<>(); | 61 | + Map<String, Object> map = new HashMap<>(); |
59 | map.put("limitFlow", openLimitFlow); | 62 | map.put("limitFlow", openLimitFlow); |
60 | map.put("apiConfs", limitConfig); | 63 | map.put("apiConfs", limitConfig); |
61 | map.put("serviceConfs", limitServiceConfig); | 64 | map.put("serviceConfs", limitServiceConfig); |
@@ -63,14 +66,14 @@ public class LimitSwitchCtrl { | @@ -63,14 +66,14 @@ public class LimitSwitchCtrl { | ||
63 | } | 66 | } |
64 | 67 | ||
65 | /** | 68 | /** |
66 | - * 修改配置 | 69 | + * 修改配置,并重启nginx |
67 | * | 70 | * |
68 | - * @return 2016年5月12日下午1:49:48 | 71 | + * @return BaseResponse |
69 | */ | 72 | */ |
70 | @RequestMapping(value = "switchConf") | 73 | @RequestMapping(value = "switchConf") |
71 | @ResponseBody | 74 | @ResponseBody |
72 | public BaseResponse switchConf() { | 75 | public BaseResponse switchConf() { |
73 | - Map map = new HashMap<>(); | 76 | + Map<String, Object> map = new HashMap<>(); |
74 | return httpRestClient.defaultGet(HttpUriContants.SWITCH_LIMIT, BaseResponse.class, map); | 77 | return httpRestClient.defaultGet(HttpUriContants.SWITCH_LIMIT, BaseResponse.class, map); |
75 | } | 78 | } |
76 | 79 |
@@ -6,18 +6,18 @@ import com.ui.model.BaseResponse; | @@ -6,18 +6,18 @@ import com.ui.model.BaseResponse; | ||
6 | import org.slf4j.Logger; | 6 | import org.slf4j.Logger; |
7 | import org.slf4j.LoggerFactory; | 7 | import org.slf4j.LoggerFactory; |
8 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
9 | -import org.springframework.core.ParameterizedTypeReference; | ||
10 | import org.springframework.stereotype.Controller; | 9 | import org.springframework.stereotype.Controller; |
11 | import org.springframework.web.bind.annotation.RequestMapping; | 10 | import org.springframework.web.bind.annotation.RequestMapping; |
12 | import org.springframework.web.bind.annotation.ResponseBody; | 11 | import org.springframework.web.bind.annotation.ResponseBody; |
13 | import org.springframework.web.servlet.ModelAndView; | 12 | import org.springframework.web.servlet.ModelAndView; |
14 | 13 | ||
15 | import java.util.HashMap; | 14 | import java.util.HashMap; |
16 | -import java.util.List; | ||
17 | import java.util.Map; | 15 | import java.util.Map; |
18 | 16 | ||
19 | /** | 17 | /** |
20 | - * @author zhengyouwei 2016年5月12日 下午1:49:55 | 18 | + * 中心入口切换 |
19 | + * | ||
20 | + * @author bblu 2016-10-27 | ||
21 | */ | 21 | */ |
22 | @Controller | 22 | @Controller |
23 | @RequestMapping("luaswitch") | 23 | @RequestMapping("luaswitch") |
@@ -29,40 +29,41 @@ public class LuaSwitchCtrl { | @@ -29,40 +29,41 @@ public class LuaSwitchCtrl { | ||
29 | HttpRestClient httpRestClient; | 29 | HttpRestClient httpRestClient; |
30 | 30 | ||
31 | /** | 31 | /** |
32 | - * 查看nginx配置 | 32 | + * 展示当前配置 |
33 | * | 33 | * |
34 | - * @return 2016年5月12日下午1:49:48 | 34 | + * @return ModelAndView |
35 | */ | 35 | */ |
36 | @RequestMapping(value = "toLuaSwitch") | 36 | @RequestMapping(value = "toLuaSwitch") |
37 | public ModelAndView viewNginxConf() { | 37 | public ModelAndView viewNginxConf() { |
38 | - String response = httpRestClient.defaultGet(HttpUriContants.VIEW_LUA_CONF, String.class,null ); | 38 | + String response = httpRestClient.defaultGet(HttpUriContants.VIEW_LUA_CONF, String.class, null); |
39 | ModelAndView mdv = new ModelAndView("switch/luaSwitch"); | 39 | ModelAndView mdv = new ModelAndView("switch/luaSwitch"); |
40 | mdv.addObject("conf", response); | 40 | mdv.addObject("conf", response); |
41 | return mdv; | 41 | return mdv; |
42 | } | 42 | } |
43 | 43 | ||
44 | /** | 44 | /** |
45 | - * 修改配置 | 45 | + * 展示修改后配置文件内容 |
46 | * | 46 | * |
47 | - * @return 2016年5月12日下午1:49:48 | 47 | + * @param cloudName 目标中心名称 |
48 | + * @return BaseResponse | ||
48 | */ | 49 | */ |
49 | @RequestMapping(value = "viewToChangeLuaConf") | 50 | @RequestMapping(value = "viewToChangeLuaConf") |
50 | @ResponseBody | 51 | @ResponseBody |
51 | public BaseResponse viewToChangeLuaConf(String cloudName) { | 52 | public BaseResponse viewToChangeLuaConf(String cloudName) { |
52 | - Map map = new HashMap<>(); | ||
53 | - map.put("cloudName",cloudName); | 53 | + Map<String, Object> map = new HashMap<>(); |
54 | + map.put("cloudName", cloudName); | ||
54 | return httpRestClient.defaultGet(HttpUriContants.VIEW_TOCHANGE_LUA_CONF, BaseResponse.class, map); | 55 | return httpRestClient.defaultGet(HttpUriContants.VIEW_TOCHANGE_LUA_CONF, BaseResponse.class, map); |
55 | } | 56 | } |
56 | 57 | ||
57 | /** | 58 | /** |
58 | - * 修改配置 | 59 | + * 切换配置,并重启nginx |
59 | * | 60 | * |
60 | - * @return 2016年5月12日下午1:49:48 | 61 | + * @return BaseResponse |
61 | */ | 62 | */ |
62 | @RequestMapping(value = "switchConf") | 63 | @RequestMapping(value = "switchConf") |
63 | @ResponseBody | 64 | @ResponseBody |
64 | public BaseResponse switchConf() { | 65 | public BaseResponse switchConf() { |
65 | - Map map = new HashMap<>(); | 66 | + Map<String, Object> map = new HashMap<>(); |
66 | return httpRestClient.defaultGet(HttpUriContants.SWITCH_LUA, BaseResponse.class, map); | 67 | return httpRestClient.defaultGet(HttpUriContants.SWITCH_LUA, BaseResponse.class, map); |
67 | } | 68 | } |
68 | 69 |
@@ -17,7 +17,9 @@ import java.util.List; | @@ -17,7 +17,9 @@ import java.util.List; | ||
17 | import java.util.Map; | 17 | import java.util.Map; |
18 | 18 | ||
19 | /** | 19 | /** |
20 | - * @author zhengyouwei 2016年5月12日 下午1:49:55 | 20 | + * nginx->gateway切换 |
21 | + * | ||
22 | + * @author bblu 2016-10-27 | ||
21 | */ | 23 | */ |
22 | @Controller | 24 | @Controller |
23 | @RequestMapping("nginxswitch") | 25 | @RequestMapping("nginxswitch") |
@@ -29,9 +31,9 @@ public class NginxSwitchCtrl { | @@ -29,9 +31,9 @@ public class NginxSwitchCtrl { | ||
29 | HttpRestClient httpRestClient; | 31 | HttpRestClient httpRestClient; |
30 | 32 | ||
31 | /** | 33 | /** |
32 | - * 查看nginx配置 | 34 | + * 展示当前配置 |
33 | * | 35 | * |
34 | - * @return 2016年5月12日下午1:49:48 | 36 | + * @return ModelAndView |
35 | */ | 37 | */ |
36 | @RequestMapping(value = "toNginxSwitch") | 38 | @RequestMapping(value = "toNginxSwitch") |
37 | public ModelAndView viewNginxConf() { | 39 | public ModelAndView viewNginxConf() { |
@@ -45,9 +47,10 @@ public class NginxSwitchCtrl { | @@ -45,9 +47,10 @@ public class NginxSwitchCtrl { | ||
45 | } | 47 | } |
46 | 48 | ||
47 | /** | 49 | /** |
48 | - * 修改配置 | 50 | + * 修改配置,并重启nginx |
49 | * | 51 | * |
50 | - * @return 2016年5月12日下午1:49:48 | 52 | + * @param cloudName 源中心名称 |
53 | + * @return BaseResponse | ||
51 | */ | 54 | */ |
52 | @RequestMapping(value = "switchNginxConf") | 55 | @RequestMapping(value = "switchNginxConf") |
53 | @ResponseBody | 56 | @ResponseBody |
@@ -58,9 +61,13 @@ public class NginxSwitchCtrl { | @@ -58,9 +61,13 @@ public class NginxSwitchCtrl { | ||
58 | } | 61 | } |
59 | 62 | ||
60 | /** | 63 | /** |
61 | - * 修改配置 | 64 | + * 展示修改后配置文件内容 |
62 | * | 65 | * |
63 | - * @return 2016年5月12日下午1:49:48 | 66 | + * @param cloudName 源中心名称 |
67 | + * @param target 目标中心名称 | ||
68 | + * @param onlineOrGray 线上/灰度切换 | ||
69 | + * @param noChangeIps 不变更配置的ip | ||
70 | + * @return BaseResponse | ||
64 | */ | 71 | */ |
65 | @RequestMapping(value = "viewToChangeNginxConf") | 72 | @RequestMapping(value = "viewToChangeNginxConf") |
66 | @ResponseBody | 73 | @ResponseBody |
-
Please register or login to post a comment