예제 #1
0
 @ResponseBody
 @RequestMapping("/delete/exec")
 public Result<?> doDelete(HttpServletRequest request, Website website) {
   Result<?> result = new Result<Object>();
   if (null != website && null != website.getId()) {
     Map<String, Object> criteria = new HashMap<String, Object>();
     criteria.put("id", website.getId());
     this.websiteApplication.removeEntity(criteria);
     result.setResultCode(Constants.Common.DEFAULT_RESULT_CODE);
   }
   return result;
 }
예제 #2
0
  @RequestMapping("/edit")
  public ModelAndView edit(HttpServletRequest request, ModelAndView mv, Website website) {
    if (null == website || null == website.getId()) {
      throw new UnifyException(SystemErrorNo.DATA_NOT_EXIST_ERROR);
    }

    Map<String, Object> criteria = new HashMap<String, Object>();
    website = this.websiteApplication.findEntity(criteria);
    if (null == website) {
      throw new UnifyException(SystemErrorNo.DATA_NOT_EXIST_ERROR);
    }

    mv.setViewName(Views.EDIT_VIEW);
    mv.addObject(Keys.KEY_PARAM, website);
    return mv;
  }