⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 postdels.java

📁 天乙社区6.0是一套基于JAVA技术的网络虚拟社区
💻 JAVA
字号:
package com.laoer.bbscs.web.action;

import com.laoer.bbscs.web.form.*;
import com.laoer.bbscs.web.servlet.*;
import com.laoer.bbscs.sys.*;
import org.apache.struts.action.*;
import javax.servlet.http.*;

/**
 * <p>Title: TianYi BBS</p>
 * <p>Description: TianYi BBS System</p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: LAOER.COM/TIANYISOFT.NET</p>
 * @author laoer
 * @version 6.0
 */

public class PostDels
    extends BaseAction {
  public ActionForward execute(ActionMapping actionMapping,
                               ActionForm actionForm,
                               HttpServletRequest httpServletRequest,
                               HttpServletResponse httpServletResponse) {
    ActionErrors errors = new ActionErrors();
    PostsForm form = (PostsForm) actionForm;
    UserCheck uc = this.getUserCheck(httpServletRequest, httpServletResponse,
                                     form.getBid());
    if (uc.isGuest()) {
      errors.add("error.pleaselogin", new ActionError("error.pleaselogin"));
      saveErrors(httpServletRequest, errors);
      //return actionMapping.findForward("login");
      return SysUtil.getPassLogin(actionMapping);
    }

    if (uc.getBs() == null) {
      errors.add("error.baordsno", new ActionError("error.baordsno"));
      saveErrors(httpServletRequest, errors);
      return actionMapping.findForward("error");
    }
    if (!uc.isCanPostNotNeedExp()) {
      errors.add("error.purviewerror", new ActionError("error.purviewerror"));
      saveErrors(httpServletRequest, errors);
      return actionMapping.findForward("error");
    }

    if (form.getAction().equals("dels")) {
      getForumService().delPosts(form.getBid(), form.getIds(), form.getDelexp(),
                                 uc);
      ActionForward f = new ActionForward("/manage" + Constant.FILEPREFIX +
                                          "?action=m&bid=" +
                                          form.getBid() + "&page=" +
                                          form.getPage(), true);
      return f;
    }
    if (form.getAction().equals("delauditings")) {
      getForumService().delAuditingPosts(form.getBid(), form.getIds(), uc);
      ActionForward f = new ActionForward("/manage" + Constant.FILEPREFIX +
                                          "?action=m&bid=" +
                                          form.getBid() + "&page=" +
                                          form.getPage(), true);
      return f;
    }

    if (form.getAction().equals("delws")) {
      this.getForumService().realDelPosts(form.getBid(), form.getIds());
      ActionForward f = new ActionForward("/manage" + Constant.FILEPREFIX +
                                          "?action=w&bid=" +
                                          form.getBid() + "&page=" +
                                          form.getPage(), true);
      return f;
    }

    if (form.getAction().equals("auditing")) {
      this.getForumService().auditingPosts(form.getBid(), form.getIds());
      ActionForward f = new ActionForward("/manage" + Constant.FILEPREFIX +
                                          "?action=a&bid=" +
                                          form.getBid() + "&page=" +
                                          form.getPage(), true);
      return f;
    }

    if (form.getAction().equals("delall")) {
      this.getForumService().delWastePost(form.getBid());
      ActionForward f = new ActionForward("/manage" + Constant.FILEPREFIX +
                                          "?action=w&bid=" +
                                          form.getBid(), true);
      return f;
    }

    if (form.getAction().equals("resume")) {
      this.getForumService().resumePosts(form.getBid(), form.getIds());
      ActionForward f = new ActionForward("/manage" + Constant.FILEPREFIX +
                                          "?action=w&bid=" +
                                          form.getBid() + "&page=" +
                                          form.getPage(), true);
      return f;
    }

    return actionMapping.findForward("error");
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -