Confirmation + Controlling API add

This commit is contained in:
mr
2026-04-10 15:16:29 +02:00
parent da4d4bd546
commit 4b9b1b8b91
13 changed files with 116 additions and 17 deletions

View File

@@ -85,6 +85,30 @@ func (o *WorkflowExecutionController) Get() {
o.ServeJSON()
}
// @Title Delete
// @Description find workflow by workflowid
// @Param id path string true "the workflowid you want to get"
// @Success 200 {workflow} models.workflow
// @router /:id [delete]
func (o *WorkflowExecutionController) Delete() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
id := o.Ctx.Input.Param(":id")
data := oclib.NewRequest(collection, user, peerID, groups, nil).LoadOne(id)
if b := data.ToBookings(); b != nil {
bAccess := oclib.NewRequestAdmin(oclib.LibDataEnum(oclib.BOOKING), nil)
s := bAccess.Search(&dbs.Filters{
And: map[string][]dbs.Filter{
"execution_id": {{Operator: dbs.EQUAL.String(), Value: b.ExecutionID}},
},
}, "", false, 0, 10000)
for _, ss := range s.Data {
bAccess.DeleteOne(ss.GetID())
}
}
o.Data["json"] = oclib.NewRequest(collection, user, peerID, groups, nil).DeleteOne(id)
o.ServeJSON()
}
// @Title Search
// @Description find compute by key word
// @Param search path string true "the search you want to get"