Exemple #1
0
 @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;
 }
Exemple #2
0
 @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;
 }