📄 functionmanagerimpl.java
字号:
package org.appfuse.service.impl;
import java.util.List;
import org.appfuse.service.*;
import org.appfuse.dao.FunctionDAO;
import org.appfuse.model.Function;
import org.appfuse.util.exception.*;
public class FunctionManagerImpl
extends BaseManager implements FunctionManager{
private FunctionDAO dao;
/**
* Set the DAO for communication with the data layer.
*
* @param dao
*/
public void setFunctionDAO(FunctionDAO dao) {
this.dao = dao;
}
/**
* @see org.appfuse.service.UserManager#getUser(java.lang.String)
*/
public Function getFunction(int actionid) throws AppSystemException,
AppBusinessException {
Function action = null;
try {
action = dao.getFunction(actionid);
}
catch (Exception e) {
log.error("获取模块信息失败!", e);
throw new AppBusinessException(e.getMessage(), e, ExceptionConstants.SYS_GENERAL_ERR);
}
return action;
}
/**
* @see org.appfuse.service.UserManager#getUsers(org.appfuse.model.User)
*/
public List getFunctions(Function action) throws AppSystemException,
AppBusinessException {
List list = null;
try {
list = dao.getFunctions(action);
}
catch (Exception e) {
log.error("获取模块列表失败!", e);
throw new AppBusinessException(e.getMessage(), e, ExceptionConstants.SYS_GENERAL_ERR);
}
return list;
}
/**
* @see org.appfuse.service.UserManager#saveUser(org.appfuse.model.User)
*/
public void saveFunction(Function action) throws AppSystemException,
AppBusinessException {
try {
dao.saveFunction(action);
}
catch (Exception e) {
log.error("保存模块失败!", e);
throw new AppBusinessException(e.getMessage(), e,
ExceptionConstants.SYS_GENERAL_ERR);
}
}
/**
* @see org.appfuse.service.UserManager#removeUser(java.lang.String)
*/
public void removeFunction(int actionid) throws AppSystemException,
AppBusinessException {
if (log.isDebugEnabled()) {
log.debug("removing user: " + actionid);
}
try {
dao.removeFunction(actionid);
}
catch (Exception e) {
log.error("删除模块失败!", e);
throw new AppBusinessException(e.getMessage(), e,
ExceptionConstants.SYS_GENERAL_ERR);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -