Ejemplo n.º 1
0
 @Log(message = "添加了{0}组织。")
 @RequiresPermissions("Organization:save")
 @RequestMapping(value = "/create", method = RequestMethod.POST)
 public @ResponseBody String create(@Valid Organization organization) {
   try {
     organizationService.saveOrUpdate(organization);
   } catch (ServiceException e) {
     return AjaxObject.newError("添加组织失败:" + e.getMessage()).toString();
   }
   LogUitls.putArgs(LogMessageObject.newWrite().setObjects(new Object[] {organization.getName()}));
   return AjaxObject.newOk("添加组织成功!").toString();
 }
Ejemplo n.º 2
0
  @Log(message = "删除了{0}组织。")
  @RequiresPermissions("Organization:delete")
  @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
  public @ResponseBody String delete(@PathVariable Long id) {
    Organization organization = organizationService.get(id);
    try {
      organizationService.delete(id);
    } catch (ServiceException e) {
      return AjaxObject.newError("删除组织失败:" + e.getMessage()).setCallbackType("").toString();
    }

    LogUitls.putArgs(LogMessageObject.newWrite().setObjects(new Object[] {organization.getName()}));
    return AjaxObject.newOk("删除组织成功!").setCallbackType("").toString();
  }