Beispiel #1
0
 /*     */ @RequestMapping(
     value = {"/shieldPosts.jsp"},
     method = {org.springframework.web.bind.annotation.RequestMethod.POST})
 /*     */ public String shieldPosts(
     Integer postsId,
     String reason,
     Integer pn,
     HttpServletRequest request,
     HttpServletResponse response,
     ModelMap model)
       /*     */ {
   /* 215 */ Posts posts = this.postsService.findById(postsId);
   /* 216 */ User user = ContextTools.getUser(request);
   /* 217 */ if (posts == null) {
     /* 218 */ return ViewTools.pageNotFound(response);
     /*     */ }
   /* 220 */ if (user == null) {
     /* 221 */ return ViewTools.showLogin(request, model, "必须登录才可以进行屏蔽操作!");
     /*     */ }
   /* 223 */ if (user.getAdmin() == null) {
     /* 224 */ return ViewTools.pageNotFound(response);
     /*     */ }
   /* 226 */ if (posts.getFloor().intValue() == 1)
     /* 227 */ this.postsService.shieldTheme(
         posts.getTheme().getId(), user.getId(), /* 228 */ reason);
   /*     */ else {
     /* 230 */ this.postsService.shieldPosts(postsId, user.getId(), reason);
     /*     */ }
   /* 232 */ if ((pn != null) && (pn.intValue() > 1)) {
     /* 233 */ return "redirect:" + posts.getTheme().getUrl(pn);
     /*     */ }
   /* 235 */ return "redirect:" + posts.getTheme().getUrl();
   /*     */ }
 /*    */ public PostsExt save(String ip, Posts posts) {
   /* 29 */ PostsExt ext = new PostsExt();
   /* 30 */ ext.setCreateIp(ip);
   /* 31 */ ext.setPosts(posts);
   /* 32 */ ext.init();
   /* 33 */ this.dao.save(ext);
   /* 34 */ posts.setExt(ext);
   /* 35 */ return ext;
   /*    */ }