查漏补缺 addMessage() messageType;

This commit is contained in:
zhangwq
2018-12-13 14:01:06 +08:00
parent 6dab8a5950
commit 46efc3320d
82 changed files with 174 additions and 146 deletions

View File

@@ -81,14 +81,14 @@ public class AsnIpController extends BaseController{
public String save(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo cfg,RedirectAttributes redirectAttributes){
try{
asnIpCfgService.saveAsnIpCfg(cfg);
addMessage(redirectAttributes,"save_success");
addMessage(redirectAttributes,"success","save_success");
}catch(Exception e){
logger.error("信息保存失败",e);
e.printStackTrace();
if(e instanceof MaatConvertException) {
addMessage(redirectAttributes,e.getMessage());
addMessage(redirectAttributes,"error",e.getMessage());
}else {
addMessage(redirectAttributes,"save_failed");
addMessage(redirectAttributes,"error","save_failed");
}
}
@@ -100,11 +100,11 @@ public class AsnIpController extends BaseController{
try{
asnIpCfgService.update(cfg);
addMessage(redirectAttributes,"save_success");
addMessage(redirectAttributes,"success","save_success");
}catch(Exception e){
logger.error("信息保存失败",e);
e.printStackTrace();
addMessage(redirectAttributes,"save_failed");
addMessage(redirectAttributes,"error","save_failed");
}
return "redirect:" + adminPath +"/basics/asn/list?functionId="+cfg.getFunctionId();
@@ -116,13 +116,13 @@ public class AsnIpController extends BaseController{
,RedirectAttributes redirectAttributes){
try{
asnIpCfgService.delete(isValid,ids);
addMessage(redirectAttributes,"delete_success");
addMessage(redirectAttributes,"success","delete_success");
}catch(Exception e){
logger.error("Delete failed",e);
if(e instanceof MaatConvertException) {
addMessage(redirectAttributes,e.getMessage());
addMessage(redirectAttributes,"error",e.getMessage());
}else {
addMessage(redirectAttributes,"delete_failed");
addMessage(redirectAttributes,"error","delete_failed");
}
}
@@ -206,7 +206,7 @@ public class AsnIpController extends BaseController{
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
} catch (Exception e) {
logger.error("asnIp export failed",e);
addMessage(redirectAttributes, "export_failed");
addMessage(redirectAttributes,"error","export_failed");
}
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
}