...
|
...
|
@@ -6,18 +6,18 @@ import com.ui.model.BaseResponse; |
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.core.ParameterizedTypeReference;
|
|
|
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.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* @author zhengyouwei 2016年5月12日 下午1:49:55
|
|
|
* 中心入口切换
|
|
|
*
|
|
|
* @author bblu 2016-10-27
|
|
|
*/
|
|
|
@Controller
|
|
|
@RequestMapping("luaswitch")
|
...
|
...
|
@@ -29,40 +29,41 @@ public class LuaSwitchCtrl { |
|
|
HttpRestClient httpRestClient;
|
|
|
|
|
|
/**
|
|
|
* 查看nginx配置
|
|
|
* 展示当前配置
|
|
|
*
|
|
|
* @return 2016年5月12日下午1:49:48
|
|
|
* @return ModelAndView
|
|
|
*/
|
|
|
@RequestMapping(value = "toLuaSwitch")
|
|
|
public ModelAndView viewNginxConf() {
|
|
|
String response = httpRestClient.defaultGet(HttpUriContants.VIEW_LUA_CONF, String.class,null );
|
|
|
String response = httpRestClient.defaultGet(HttpUriContants.VIEW_LUA_CONF, String.class, null);
|
|
|
ModelAndView mdv = new ModelAndView("switch/luaSwitch");
|
|
|
mdv.addObject("conf", response);
|
|
|
return mdv;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 修改配置
|
|
|
* 展示修改后配置文件内容
|
|
|
*
|
|
|
* @return 2016年5月12日下午1:49:48
|
|
|
* @param cloudName 目标中心名称
|
|
|
* @return BaseResponse
|
|
|
*/
|
|
|
@RequestMapping(value = "viewToChangeLuaConf")
|
|
|
@ResponseBody
|
|
|
public BaseResponse viewToChangeLuaConf(String cloudName) {
|
|
|
Map map = new HashMap<>();
|
|
|
map.put("cloudName",cloudName);
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("cloudName", cloudName);
|
|
|
return httpRestClient.defaultGet(HttpUriContants.VIEW_TOCHANGE_LUA_CONF, BaseResponse.class, map);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 修改配置
|
|
|
* 切换配置,并重启nginx
|
|
|
*
|
|
|
* @return 2016年5月12日下午1:49:48
|
|
|
* @return BaseResponse
|
|
|
*/
|
|
|
@RequestMapping(value = "switchConf")
|
|
|
@ResponseBody
|
|
|
public BaseResponse switchConf() {
|
|
|
Map map = new HashMap<>();
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
return httpRestClient.defaultGet(HttpUriContants.SWITCH_LUA, BaseResponse.class, map);
|
|
|
}
|
|
|
|
...
|
...
|
|