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

📄 deletemessageaction.java

📁 新技术论坛系统 v1.0 前后台管理的初始用户名 : admin 密码 123456
💻 JAVA
字号:
package com.ntsky.bbs.web.webwork.action.message;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import com.opensymphony.webwork.interceptor.SessionAware;
import com.opensymphony.xwork.ModelDriven;

import com.ntsky.framework.util.StringUtil;

import com.ntsky.bbs.Symbols;
import com.ntsky.bbs.domain.Message;
import com.ntsky.bbs.exception.ActionException;
import com.ntsky.bbs.exception.ServiceException;

/**
 * 删除消息
 *  
 * @author ntsky
 * @link www.ntsky.com
 * 
 * @version $Revision: 1.4 $ $Date: 2006/07/28 17:04:29 $
 */
public class DeleteMessageAction extends MessageActionSupport {

	/**
	 * 清空废件箱
	 */
	public String cleanTrash() throws Exception {
		if(logger.isInfoEnabled()){
			logger.info("清空废件箱");
		}
		try{
			messageService.cleanTrash(super.getSessionUser().getUsername());
		}
		catch(ServiceException se){
			throw new ActionException(se);
		}
		return SUCCESS;
	}

	private int messageId;
	public void setMessageId(int messageId){
		this.messageId = messageId;
	}
	
	/**
	 * 删除单个短消息
	 * @return
	 * @throws Exception
	 */
	public String deleteOne() throws Exception {
		if(logger.isInfoEnabled()){
			logger.info("删除单个短信息...");
		}
		try{
			messageService.deleteMessage(messageId);
		}
		catch(ServiceException se){
			throw new ActionException(se);
		}
		if(logger.isInfoEnabled()){
			logger.info("删除单个短信息成功.");
		}
		return SUCCESS;
	}
	
	/**
	 * 删除单个接收的短消息
	 * @return
	 * @throws Exception
	 */
	public String deleteOne_receiver() throws Exception {
		if(logger.isInfoEnabled()){
			logger.info("删除单个接收的短信息...");
		}
		try{
			messageService.deleteMessage(messageId,Symbols.MESSAGE_RECEIVER);
		}
		catch(ServiceException se){
			throw new ActionException(se);
		}
		if(logger.isInfoEnabled()){
			logger.info("删除单个接收的短信息成功.");
		}
		return SUCCESS;
	}
	
	/**
	 * 删除单个发送的短消息
	 * @return
	 * @throws Exception
	 */
	public String deleteOne_sender() throws Exception {
		if(logger.isInfoEnabled()){
			logger.info("删除单个发送的短信息...");
		}
		try{
			messageService.deleteMessage(messageId,Symbols.MESSAGE_SENDER);
		}
		catch(ServiceException se){
			throw new ActionException(se);
		}
		if(logger.isInfoEnabled()){
			logger.info("删除单个发送的短信息成功.");
		}
		return SUCCESS;
	}	
	
	private Integer[] ids;
	public void setId(Integer[] ids){
		this.ids = ids;
	}
	
	/**
	 * 删除多个短消息
	 * @return
	 * @throws Exception
	 */
	public String deleteMore() throws Exception {
		if(logger.isInfoEnabled()){
			logger.info("删除多个短信息...");
		}
		try{
			messageService.deleteMoreMessage(ids);
		}
		catch(ServiceException se){
			throw new ActionException(se);
		}
		return SUCCESS;
	}
	
	/**
	 * 删除多个发送的短消息
	 * @return
	 * @throws Exception
	 */
	public String deleteMore_sender() throws Exception {
		if(logger.isInfoEnabled()){
			logger.info("删除多个发送的短信息...");
		}
		try{
			messageService.deleteMoreMessage(ids,Symbols.MESSAGE_SENDER);
		}
		catch(ServiceException se){
			throw new ActionException(se);
		}
		return SUCCESS;
	}
	
	/**
	 * 删除多个接收的短消息
	 * @return
	 * @throws Exception
	 */
	public String deleteMore_receiver() throws Exception {
		if(logger.isInfoEnabled()){
			logger.info("删除多个接收的短信息...");
		}
		try{
			messageService.deleteMoreMessage(ids,Symbols.MESSAGE_RECEIVER);
		}
		catch(ServiceException se){
			throw new ActionException(se);
		}
		return SUCCESS;
	}
	
	
}

⌨️ 快捷键说明

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