use of io.jpom.model.script.ScriptExecuteLogModel in project Jpom by dromara.
the class ServerScriptHandler method createLog.
/**
* 创建执行日志
*
* @param attributes 参数属性
* @return 执行ID
*/
private String createLog(Map<String, Object> attributes, ScriptModel scriptModel) {
UserModel userModel = (UserModel) attributes.get("userInfo");
//
try {
BaseServerController.resetInfo(userModel);
//
ScriptModel scriptCacheModel = new ScriptModel();
scriptCacheModel.setId(scriptModel.getId());
scriptCacheModel.setLastRunUser(userModel.getId());
nodeScriptServer.update(scriptCacheModel);
//
ScriptExecuteLogModel scriptExecuteLogCacheModel = logServer.create(scriptModel, 0);
return scriptExecuteLogCacheModel.getId();
} finally {
BaseServerController.removeAll();
}
}
use of io.jpom.model.script.ScriptExecuteLogModel in project Jpom by dromara.
the class ScriptExecuteLogServer method create.
/**
* 创建执行记录
*
* @param scriptModel 脚本
* @param type 执行类型
* @return 对象
*/
public ScriptExecuteLogModel create(ScriptModel scriptModel, int type) {
ScriptExecuteLogModel scriptExecuteLogModel = new ScriptExecuteLogModel();
scriptExecuteLogModel.setScriptId(scriptModel.getId());
scriptExecuteLogModel.setScriptName(scriptModel.getName());
scriptExecuteLogModel.setTriggerExecType(type);
scriptExecuteLogModel.setWorkspaceId(scriptModel.getWorkspaceId());
super.insert(scriptExecuteLogModel);
return scriptExecuteLogModel;
}
Aggregations