IP地址新增后直接生效及热修改功能
This commit is contained in:
@@ -108,7 +108,22 @@ public class IpController extends BaseController{
|
|||||||
}
|
}
|
||||||
@RequestMapping(value = {"saveOrUpdate"})
|
@RequestMapping(value = {"saveOrUpdate"})
|
||||||
public String saveOrUpdate(RedirectAttributes model,HttpServletRequest request,HttpServletResponse response,String ids,CfgIndexInfo entity) {
|
public String saveOrUpdate(RedirectAttributes model,HttpServletRequest request,HttpServletResponse response,String ids,CfgIndexInfo entity) {
|
||||||
ipCfgService.saveIpCfg(entity);
|
try {
|
||||||
|
ipCfgService.saveIpCfg(entity);
|
||||||
|
//配置仅保存
|
||||||
|
if(StringUtil.isEmpty(entity.getIsValid()) || entity.getIsValid()!=1) {
|
||||||
|
addMessage(model, "success", "save_success");
|
||||||
|
}else {
|
||||||
|
//配置直接生效
|
||||||
|
addMessage(model, "success", "audit_success");
|
||||||
|
}
|
||||||
|
} catch (MaatConvertException e) {
|
||||||
|
logger.error("ip地址配置下发失败:",e);
|
||||||
|
addMessage(model, "error", "request_service_failed");
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("ip地址配置保存失败:",e);
|
||||||
|
addMessage(model, "error", "save_failed");
|
||||||
|
}
|
||||||
return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"ajaxSubList"})
|
@RequestMapping(value = {"ajaxSubList"})
|
||||||
@@ -151,8 +166,27 @@ public class IpController extends BaseController{
|
|||||||
}
|
}
|
||||||
@RequestMapping(value = {"updateValid"})
|
@RequestMapping(value = {"updateValid"})
|
||||||
@RequiresPermissions("iplist:config")
|
@RequiresPermissions("iplist:config")
|
||||||
public String updateIpPortCfgValid(Integer isValid,String ids,Integer functionId) {
|
public String updateIpPortCfgValid(Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes,
|
||||||
ipCfgService.updateIpCfgValid(isValid, ids, functionId);
|
HttpServletRequest request, HttpServletResponse response, @ModelAttribute("cfg")CfgIndexInfo cfg) {
|
||||||
|
try {
|
||||||
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
|
ipCfgService.updateIpCfgValid(isValid, ids, functionId);
|
||||||
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
|
}else {
|
||||||
|
// 批量删除
|
||||||
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
|
deleteAll(searchPage, functionId, cfg);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("配置删除失败:", e);
|
||||||
|
if (e instanceof MaatConvertException) {
|
||||||
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
|
} else {
|
||||||
|
addMessage(redirectAttributes, "error", "delete_failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+functionId;
|
return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+functionId;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user