📄 updatefunction.java
字号:
package org.artemis.right.command;
import java.util.Map;
import org.artemis.right.common.ErrorCode;
import org.artemis.right.dao.FunctionDao;
import org.artemis.right.model.Function;
import com.gsta.eshore.framework.jcf.Command;
import com.gsta.eshore.framework.jcf.JCFException;
import com.gsta.eshore.framework.util.AppUtils;
public class UpdateFunction extends Command
{
private FunctionDao dao;
public void setDao(FunctionDao dao) {
this.dao = dao;
}
public void execute(Map params, Map response) throws Exception
{
Function function = (Function) params.get("function");
if (checkFunction(function)) {
String msg = "UpdateFunction PARAM_ERR ,function is not validated!";
throw new JCFException(ErrorCode.PARAMETER_ERROR, msg);
}
dao.update(function);
}
private boolean checkFunction(Function fuction){
if(AppUtils.isBlank(fuction)||fuction.getId()==null)
return true;
else
return false;
}
public void fini() throws JCFException
{
}
public void init(String arg0) throws JCFException
{
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -