コード例 #1
0
ファイル: ActController.java プロジェクト: huaj12/weguan
 @RequestMapping(value = "/removeShield", method = RequestMethod.POST)
 @ResponseBody
 public AjaxResult removeSynonym(HttpServletRequest request, Model model, long actId) {
   AjaxResult ajaxResult = new AjaxResult();
   if (actService.actExist(actId)) {
     actService.removeActShield(actId);
     ajaxResult.setSuccess(true);
   }
   return ajaxResult;
 }
コード例 #2
0
ファイル: ActController.java プロジェクト: huaj12/weguan
 @RequestMapping(value = "/addSynonym", method = RequestMethod.POST)
 @ResponseBody
 public AjaxResult addSynonym(
     HttpServletRequest request, Model model, long actId, String synonymActName) {
   AjaxResult ajaxResult = new AjaxResult();
   if (actService.actExist(actId)) {
     try {
       actService.addSynonym(actId, synonymActName);
       ajaxResult.setSuccess(true);
     } catch (ActInputException e) {
       ajaxResult.setSuccess(false);
       ajaxResult.setErrorCode(e.getErrorCode());
       ajaxResult.setErrorInfo(
           messageSource.getMessage(e.getErrorCode(), null, Locale.SIMPLIFIED_CHINESE));
     }
   } else {
     ajaxResult.setErrorInfo("The act is null");
   }
   return ajaxResult;
 }