Exemplo n.º 1
0
 /**
  * @Description 获取列表数据
  *
  * @param request
  * @param model
  * @author davidwan
  */
 private void getList(HttpServletRequest request, Model model) {
   int pageSize = WebUtil.getInt(request, "page_size", ConfigValue.PAGE_SIZE);
   int pageIndex = WebUtil.getInt(request, "page_index", 0);
   String name = WebUtil.getString(request, "name", "");
   EmailReceiver entity = new EmailReceiver();
   if (StringUtils.isNotBlank(name)) {
     // entity.setName(name);
   }
   PageInfo<EmailReceiver> pageInfo =
       emailReceiverService.queryPageList(entity, pageIndex, pageSize);
   model.addAttribute("list", pageInfo.getData());
   model.addAttribute("pageInfo", pageInfo);
 }
Exemplo n.º 2
0
 /**
  * @Title: add @Description: Ajax保存添加数据
  *
  * @param entity
  * @return JsonResult
  */
 @RequestMapping(value = "/add", method = RequestMethod.POST)
 public @ResponseBody JsonResult add(EmailReceiver entity) {
   return emailReceiverService.create(entity);
 }
Exemplo n.º 3
0
 /**
  * @Description 进入详情页面
  *
  * @param id
  * @param model
  * @return String
  * @author davidwan
  */
 @RequestMapping("/view")
 public String view(Integer id, Model model) {
   EmailReceiver entity = emailReceiverService.findById(id);
   model.addAttribute("model", entity);
   return getPathView();
 }
Exemplo n.º 4
0
 /**
  * @Title: batchDelete @Description: Ajax批量删除
  *
  * @param ids
  * @return JsonResult
  */
 @RequestMapping(value = "/batchdelete", method = RequestMethod.POST)
 public @ResponseBody JsonResult batchDelete(String ids) {
   return emailReceiverService.removeByIds(ids);
 }
Exemplo n.º 5
0
 /**
  * @Title: delete @Description: Ajax删除
  *
  * @param id
  * @return JsonResult
  */
 @RequestMapping(value = "/delete", method = RequestMethod.POST)
 @ResponseBody
 public JsonResult delete(Integer id) {
   return emailReceiverService.removeById(id);
 }
Exemplo n.º 6
0
 /**
  * @Title: update @Description: Ajax保存修改信息
  *
  * @param entity
  * @return JsonResult
  */
 @RequestMapping(value = "/update", method = RequestMethod.POST)
 public @ResponseBody JsonResult update(EmailReceiver entity) {
   return emailReceiverService.modify(entity);
 }