use of io.jpom.model.node.ProjectInfoCacheModel in project Jpom by dromara.
the class ProjectInfoCacheService method exists.
public boolean exists(String workspaceId, String nodeId, String id) {
ProjectInfoCacheModel projectInfoCacheModel = new ProjectInfoCacheModel();
projectInfoCacheModel.setWorkspaceId(workspaceId);
projectInfoCacheModel.setNodeId(nodeId);
projectInfoCacheModel.setProjectId(id);
return super.exists(projectInfoCacheModel);
}
use of io.jpom.model.node.ProjectInfoCacheModel in project Jpom by dromara.
the class MonitorItem method notifyMsg.
private void notifyMsg(NodeModel nodeModel, MonitorNotifyLog monitorNotifyLog) {
List<String> notify = monitorModel.notifyUser();
// 发送通知
if (monitorNotifyLog.getTitle() == null) {
return;
}
ProjectInfoCacheModel projectInfoCacheModel = projectInfoCacheService.getData(nodeModel.getId(), monitorNotifyLog.getProjectId());
//
notify.forEach(notifyUser -> this.sendNotifyMsgToUser(monitorNotifyLog, notifyUser));
//
this.sendNotifyMsgToWebhook(monitorNotifyLog, nodeModel, projectInfoCacheModel, monitorModel.getWebhook());
}
use of io.jpom.model.node.ProjectInfoCacheModel in project Jpom by dromara.
the class NodeEditController method del.
/**
* 删除节点
*
* @param id 节点id
* @return json
*/
@PostMapping(value = "del.json", produces = MediaType.APPLICATION_JSON_VALUE)
@Feature(method = MethodFeature.DEL)
public String del(@ValidatorItem String id) {
HttpServletRequest request = getRequest();
this.checkDataBind(id, request);
//
{
ProjectInfoCacheModel projectInfoCacheModel = new ProjectInfoCacheModel();
projectInfoCacheModel.setNodeId(id);
projectInfoCacheModel.setWorkspaceId(projectInfoCacheService.getCheckUserWorkspace(request));
boolean exists = projectInfoCacheService.exists(projectInfoCacheModel);
Assert.state(!exists, "该节点下还存在项目,不能删除");
}
//
{
ScriptCacheModel scriptCacheModel = new ScriptCacheModel();
scriptCacheModel.setNodeId(id);
scriptCacheModel.setWorkspaceId(nodeScriptServer.getCheckUserWorkspace(request));
boolean exists = nodeScriptServer.exists(scriptCacheModel);
Assert.state(!exists, "该节点下还存在脚本模版,不能删除");
}
//
this.delNodeData(id, request);
return JsonMessage.getString(200, "操作成功");
}
Aggregations