deletefavoriteaction.java

来自「新技术论坛系统 v1.0 前后台管理的初始用户名 : admin 密码 123」· Java 代码 · 共 77 行

JAVA
77
字号
package com.ntsky.bbs.web.webwork.action.favorite;

import com.opensymphony.xwork.ModelDriven;

import com.ntsky.bbs.domain.Favorite;
import com.ntsky.bbs.exception.ActionException;
import com.ntsky.bbs.exception.ServiceException;

/**
 * 删除收藏夹信息
 *  
 * @author ntsky
 * @link www.ntsky.com
 * 
 * @version $Revision: 1.2 $ $Date: 2006/06/15 07:37:03 $
 */
public class DeleteFavoriteAction extends FavoriteActionSupport {

	private Favorite favorite = new Favorite();
	
	/**
	 * 收藏夹编号
	 */
	private int favId;
	public void setFavId(int favId){
		this.favId = favId;
	}
	
	/**
	 * 删除单个收藏夹信息
	 */
	public String deleteOne() throws Exception {
		try{
			favoriteService.deleteFavorite(favId);
		}
		catch(ServiceException se){
			throw new ActionException(se);
		}
		return SUCCESS;
	}
	
	private int[] ids;
	public void setId(int[] ids){
		this.ids = ids;
	}
	/**
	 * 删除多个收藏夹
	 * @return
	 * @throws Exception
	 */
	public String deleteMore() throws Exception {
		try{
			favoriteService.deleteMoreFavorite(ids);
		}
		catch(ServiceException se){
			throw new ActionException(se);
		}
		return SUCCESS;
	}

	/**
	 * 清空用户收藏夹
	 * @return
	 * @throws Exception
	 */
	public String clearUserFavorite() throws Exception {
		try{
			favoriteService.clearUserFavorte(super.getSessionUser().getId().intValue());
		}
		catch(ServiceException se){
			throw new ActionException(se);
		}
		return SUCCESS;
	}

}

⌨️ 快捷键说明

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