增加高级功能菜单下的配置审核不通过、删除功能.

This commit is contained in:
zhangwenqing
2019-04-15 16:23:14 +08:00
parent ecb1fed2d5
commit a2f8cf56d3
13 changed files with 491 additions and 128 deletions

View File

@@ -314,7 +314,7 @@ public class AppCfgController extends BaseController {
addMessage(redirectAttributes, "success", "delete_success");
}else {
// 批量删除
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
Page<AppPolicyCfg> searchPage = new Page<AppPolicyCfg>(request, response, "a");
deleteAll(searchPage, functionId, cfg);
}
} catch (Exception e) {
@@ -492,8 +492,26 @@ public class AppCfgController extends BaseController {
*/
@RequestMapping(value = { "updateAppIpCfgValid" })
@RequiresPermissions(value = { "app:ip:config" })
public String updateAppIpCfgValid(Integer isValid, String ids, Integer functionId) {
appCfgService.updateAppIpCfgValid(isValid, ids, functionId);
public String updateAppIpCfgValid(Integer isValid, String ids, Integer functionId, RedirectAttributes redirectAttributes,
HttpServletRequest request, HttpServletResponse response, @ModelAttribute("cfg")AppIpCfg cfg) {
try {
if (!StringUtil.isEmpty(ids)) {
appCfgService.updateAppIpCfgValid(isValid, ids, functionId);
addMessage(redirectAttributes, "success", "delete_success");
}else {
// 批量删除
Page<AppIpCfg> searchPage = new Page<AppIpCfg>(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 + "/app/ipCfgList?functionId=" + functionId;
}
@@ -803,8 +821,26 @@ public class AppCfgController extends BaseController {
*/
@RequestMapping(value = { "updateAppDomainCfgValid" })
@RequiresPermissions(value = { "app:domain:config" })
public String updateAppDomainCfgValid(Integer isValid, String ids, Integer functionId) {
appCfgService.updateAppDomainCfgValid(isValid, ids, functionId);
public String updateAppDomainCfgValid(Integer isValid, String ids, Integer functionId, RedirectAttributes redirectAttributes,
HttpServletRequest request, HttpServletResponse response, @ModelAttribute("cfg")AppDomainCfg cfg) {
try {
if (!StringUtil.isEmpty(ids)) {
appCfgService.updateAppDomainCfgValid(isValid, ids, functionId);
addMessage(redirectAttributes, "success", "delete_success");
}else {
// 批量删除
Page<AppDomainCfg> searchPage = new Page<AppDomainCfg>(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 + "/app/domainCfgList?functionId=" + functionId;
}
@@ -1558,20 +1594,24 @@ public class AppCfgController extends BaseController {
*/
@RequestMapping(value = { "updateAppTopicDomainCfgValid" })
@RequiresPermissions(value = { "app:topic:config" })
public String updateAppTopicDomainCfgValid(Integer isValid, String ids, Integer functionId,
RedirectAttributes redirectAttributes) {
public String updateAppTopicDomainCfgValid(Integer isValid, String ids, Integer functionId, RedirectAttributes redirectAttributes,
HttpServletRequest request, HttpServletResponse response, @ModelAttribute("cfg")AppTopicDomainCfg cfg) {
try {
appCfgService.updateAppTopicDomainCfgValid(isValid, ids, functionId);
addMessage(redirectAttributes, "success", "delete_success");
if (!StringUtil.isEmpty(ids)) {
appCfgService.updateAppTopicDomainCfgValid(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("app主题网站删除失败", e);
if (e instanceof MaatConvertException) {
e.printStackTrace();
addMessage(redirectAttributes, "error", "request_service_failed");
} else if (e instanceof CallExternalProceduresException) {
addMessage(redirectAttributes, "error", "call_external_procedures_failed");
} else {
e.printStackTrace();
addMessage(redirectAttributes, "error", "delete_failed");
}
}

View File

@@ -225,8 +225,26 @@ public class AppFeatureCfgController extends BaseController {
* @return
*/
@RequestMapping(value = { "updateAppFeatureCfgValid" })
public String updateAppFeatureCfgValid(Integer isValid, String ids, Integer functionId) {
appMultiFeatureCfgService.updateAppFeatureCfgValid(isValid, ids, functionId);
public String updateAppFeatureCfgValid(Integer isValid, String ids, Integer functionId, RedirectAttributes redirectAttributes,
HttpServletRequest request, HttpServletResponse response, @ModelAttribute("cfg")AppFeatureIndex cfg) {
try {
if (!StringUtil.isEmpty(ids)) {
appMultiFeatureCfgService.updateAppFeatureCfgValid(isValid, ids, functionId);
addMessage(redirectAttributes, "success", "delete_success");
}else {
// 批量删除
Page<AppFeatureIndex> searchPage = new Page<AppFeatureIndex>(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 + "/app/feature/multiFeatureCfgList?functionId=" + functionId;
}

View File

@@ -258,7 +258,7 @@ public class BasicProtocolController extends BaseController {
appCfgService.updateAppPolicyCfgValid(isValid, ids, functionId);
addMessage(redirectAttributes, "success", "delete_success");
}else {
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
Page<AppPolicyCfg> searchPage = new Page<AppPolicyCfg>(request, response, "a");
deleteAll(searchPage, functionId, cfg);
}
} catch (Exception e) {

View File

@@ -279,7 +279,7 @@ public class EncryptedTunnelBehaviorController extends BaseController {
addMessage(redirectAttributes, "success", "delete_success");
}else {
// 批量删除
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
Page<AppPolicyCfg> searchPage = new Page<AppPolicyCfg>(request, response, "a");
deleteAll(searchPage, functionId, cfg);
}
} catch (Exception e) {

View File

@@ -114,9 +114,26 @@ public class DnsIpCfgController extends BaseController {
@RequestMapping(value = { "/delete" })
@RequiresPermissions(value = { "dns:fake:ip:config" })
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId,
RedirectAttributes redirectAttributes) {
dnsIpCfgService.delete(isAudit, isValid, ids, functionId);
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, RedirectAttributes redirectAttributes,
HttpServletRequest request, HttpServletResponse response, @ModelAttribute("cfg")DnsIpCfg cfg) {
try {
if (!StringUtil.isEmpty(ids)) {
dnsIpCfgService.delete(isAudit, isValid, ids, functionId);
addMessage(redirectAttributes, "success", "delete_success");
}else {
// 批量删除
Page<DnsIpCfg> searchPage = new Page<DnsIpCfg>(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 + "/cfg/dnsIp/list?functionId=" + functionId;
}

View File

@@ -103,12 +103,26 @@ public class DnsResStrategyController extends BaseController {
@RequestMapping(value = { "/delete" })
@RequiresPermissions(value = { "dns:res:strategy:config" })
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model,
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model, @ModelAttribute("cfg")DnsResStrategy cfg,
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
if (!StringUtil.isEmpty(ids)) {
dnsResStrategyService.delete(isAudit, isValid, ids, functionId);
}
try {
if (!StringUtil.isEmpty(ids)) {
dnsResStrategyService.delete(isAudit, isValid, ids, functionId);
addMessage(redirectAttributes, "success", "delete_success");
}else {
// 批量删除
Page<DnsResStrategy> searchPage = new Page<DnsResStrategy>(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 + "/maintenance/dnsResStrategy/list?functionId=" + functionId;
}

View File

@@ -95,7 +95,7 @@ public class DdosCfgController extends BaseController {
addMessage(redirectAttributes, "success", "delete_success");
}else {
// 批量删除
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
Page<DdosIpCfg> searchPage = new Page<DdosIpCfg>(request, response, "a");
deleteAll(searchPage, functionId, cfg);
}
} catch (Exception e) {

View File

@@ -358,7 +358,7 @@ public class AvController extends BaseController {
addMessage(redirectAttributes, "success", "delete_success");
}else {
// 批量删除
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
Page<AvFileSampleCfg> searchPage = new Page<AvFileSampleCfg>(request, response, "a");
deleteAll(searchPage, functionId, cfg);
}
} catch (Exception e) {

View File

@@ -328,10 +328,25 @@ public class PxyObjKeyringController extends BaseController {
@RequestMapping(value = { "/delete" })
@RequiresPermissions(value = { "proxy:intercept:config" })
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model,
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model, @ModelAttribute("cfg")PxyObjKeyring cfg,
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
if (!StringUtil.isEmpty(ids)) {
pxyObjKeyringService.delete(isAudit, isValid, ids, functionId);
try {
if (!StringUtil.isEmpty(ids)) {
pxyObjKeyringService.delete(isAudit, isValid, ids, functionId);
addMessage(redirectAttributes, "success", "delete_success");
}else {
// 批量删除
Page<PxyObjKeyring> searchPage = new Page<PxyObjKeyring>(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 + "/proxy/intercept/strateagy/list?functionId=" + functionId;
@@ -860,11 +875,25 @@ public class PxyObjKeyringController extends BaseController {
@RequestMapping(value = { "/trustedCertDelete" })
@RequiresPermissions(value = { "proxy:trustedCert:config" })
public String trustedCertDelete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model,
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
if (!StringUtil.isEmpty(ids)) {
pxyObjKeyringService.trustedCertDelete(isAudit, isValid, ids, functionId);
}
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes, @ModelAttribute PxyObjTrustedCaCert cfg) {
try {
if (!StringUtil.isEmpty(ids)) {
pxyObjKeyringService.trustedCertDelete(isAudit, isValid, ids, functionId);
addMessage(redirectAttributes, "success", "delete_success");
}else {
// 批量删除
Page<PxyObjKeyring> searchPage = new Page<PxyObjKeyring>(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 + "/proxy/intercept/strateagy/trustedCertList?functionId=" + functionId;
}