📄 admindeletecategoryaction.java
字号:
package com.ntsky.bbs.web.webwork.action.category;
import com.opensymphony.xwork.ModelDriven;
import com.ntsky.bbs.domain.Category;
import com.ntsky.bbs.domain.Forum;
import com.ntsky.bbs.exception.ActionException;
import com.ntsky.bbs.exception.ServiceException;
import com.ntsky.bbs.util.memory.ForumSingleton;
/**
* 删除主题类别
*
* @author ntsky
* @link www.ntsky.com
*
* @version $Revision: 1.2 $ $Date: 2007/04/01 17:18:24 $
*/
public class AdminDeleteCategoryAction extends CategoryActionSupport {
private int categoryId;
public void setCategoryId(int categoryId){
this.categoryId = categoryId;
}
private int forumId;
public void setForumId(int forumId){
this.forumId = forumId;
}
public int getForumId(){
return this.forumId;
}
/**
* 用户删除类别
* @return
* @throws Exception
*/
public String execute() throws Exception {
// ---------- 权限 ------------
// 是否为论坛管理员
if(!super.isForumManage(forumId)){
setWarnMessage("您不是该论坛管理员,您没有删除论坛专题的权限.");
return NO_PERMISSION;
}
if(super.isAccess("canCategory")==0){
setWarnMessage("您所属的角色没有删除论坛专题的权限.");
return NO_PERMISSION;
}
// ---------------------------
try{
categoryService.deleteCategory(categoryId);
}
catch(ServiceException se){
throw new ActionException(se);
}
return SUCCESS;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -